Godoc stylesheet and javascript - go

I know Godoc -html generates HTML only without stylesheets and javascript, but once generated where can I get those from?
I got css and js from godoc.org but it seems the js doesn't work with the html markup that is generated by godoc
I just want to try this out without using godoc server
Example markup:
<div id="pkg-overview" class="toggleVisible">
<div class="collapsed">
<h2 class="toggleButton" title="Click to show Overview section">Overview ▹</h2>
</div>
<div class="expanded">
<h2 class="toggleButton" title="Click to hide Overview section">Overview ▾</h2>
<p>Hello World
</p>
</div>
</div>

You can try and have a look in tools#hg/godoc/static
You will find a godoc/static/godocs.js which might help.
It is used by godoc/static/godoc.html anyway.
godoc.html also uses:
godoc/static/style.css
godoc/static/jquery.treeview.css

Related

Laravel and Vue: How do I get images from my public folder in a Vue component?

I am trying to get a logo image from my public folder in my laravel and Vue application. The file is called index.vue and have the following structure:
<template>
<div>
<div class="header-container">
<div class="header-content">
<div class="logo-container">
<img :src="'/public/images/logo/black.png'" alt="logo">
</div>
</div>
</div>
<!-- Tell Vue where to render components -->
<router-view></router-view>
</div>
</template>
Here is the file structure and you can see that file exists and the path is correct:
But when I switch back to the view it looks like this:
I have also tried to call it the way I would in a blade template using {{ asset() }}, but this doesn't work and gives me a compiler error.
How do I get this image to load in my Vue file?
Not sure about vue + laravel. But, since its a relative path I dont think you need to bind anything.
<img src="/images/logo/black.png" alt="logo">

Turbolink is not working in Livewire version 2

i am working on my new project and technology stack is: laravel 8 + Livewire V2 + Jetstream, to create a single page application (SPA). but I am still confused if its possible SPA in my selected technology stack or not.
I know Livewire no longer supports Turbolinks out of the box so they provided Turbolinks adapter. I have followed the documentation but seems like its not working. please help me to understand the issue and let me know if SPA is possible or not in Livewire version 2.
here is my code:
<div class="min-h-screen bg-gray-100">
#livewire('navigation-menu')
<!-- Page Heading -->
#if (isset($header))
<header class="bg-white shadow">
<div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
{{ $header }}
</div>
</header>
#endif
<!-- Page Content -->
<main>
{{ $slot }}
</main>
</div>
#stack('modals')
#livewireScripts
<script src="https://cdn.jsdelivr.net/gh/livewire/turbolinks#v0.1.x/dist/livewire-turbolinks.js" data-turbolinks-eval="false"></script>
Livewire Version 1 supported Turbolinks internally. Livewire Version 2 has removed internal support and extracted it into this plugin.
The goal of this livewire version 2 is to provide full Turbolinks/Turbo support in Livewire.
add hotwired/turbo package on your layout below #livewireScripts
add livewire/turbolinks package on your layout below hotwired/turbo package
#livewireScripts
<script type="module">
import hotwiredTurbo from 'https://cdn.skypack.dev/#hotwired/turbo';
</script>
<script src="https://cdn.jsdelivr.net/gh/livewire/turbolinks#v0.1.x/dist/livewire-turbolinks.js" data-turbolinks-eval="false" data-turbo-eval="false"></script>
You need to install Turbolink module first, Please go Turbolinks documentation Here.
Support for Turbolink has been removed in Livewire 2. So you need to add an extra JS script to make it work.
More here => https://github.com/livewire/turbolinks
Just add this after your livewire script:
<script src="https://cdn.jsdelivr.net/gh/livewire/turbolinks#v0.1.x/dist/livewire-turbolinks.js" data-turbolinks-eval="false" data-turbo-eval="false"></script>
Example:
#livewireScripts
<script src="https://cdn.jsdelivr.net/gh/livewire/turbolinks#v0.1.x/dist/livewire-turbolinks.js" data-turbolinks-eval="false" data-turbo-eval="false"></script>

Vuejs view source - I can still see directives after compilation

When I compile my vuejs and then do a view source (chrome) I still see the directives and variable place holders?
<nav #click="toggleNav"></nav>
<span class="title">{{ pageName }}</span>
I am pulling it in via
<script src="https://unpkg.com/vue/dist/vue.js"></script>
When I try to validate via the W3c I get loads of errors. Should these not be compiled down?
Should I make anything with a directive on it a component so it does not show in my html?

How can i create new blade in laravel 5.1

I just started using laravel and created a new login page. My issue is how can i create new blade.php file. When I copy the old one, my CSS file is used in the body. I want to make a new blade file. Also, can anyone suggest the best way to make login page.
<html>
<head>
{!! HTML::style('css/main.css') !!}
</head>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600' rel='stylesheet' type='text/css'>
<link href="//netdna.bootstrapcdn.com/font-awesome/3.1.1/css/font-awesome.css" rel="stylesheet">
<body>
<div class="form">
<ul class="tab-group">
<li class="tab active">Sign Up</li>
<li class="tab">Log In</li>
</ul>
<div class="tab-content">
<div id="signup">
<h1>Sign Up for Free</h1>
<form action="/" method="post">
<div class="top-row">
<div class="field-wrap">
<label>
First Name<span class="req">*</span>
</label>
<input type="text" required autocomplete="off" />
</div>
Blade templates are found on Resources/views folder. As suggested in the comment you just create a new file then add .blade.php extension to it.
blade files use html and if your comfortable with html5 tackle task as if you were writing plain html.
To get you started check this out http://laravel.com/docs/5.1/blade
Make sure you have installed laravelcollective/html
Follow the below steps,
add "laravelcollective/html": "5.1.*" in the require feild inside composer.json file in the root of the project.
Run composer update from root of your project. This will install the package required for blade templating by laravel.
In config/app.php, under providers add Collective\Html\HtmlServiceProvider::class.
In config/app.php, under aliases add 'Form'=>Collective\Html\FormFacade::class and
'Html'=>Collective\Html\HtmlFacade::class.
Thankyou :)

How do I place a magento autocomplete mini search box outside the magento installation?

I would like to put a magento mini search box in my main website, so that when a search is made, it redirects to the magento search results page. This global search is in the header and helps to find products fast on my Codeigniter main site. I was able to achieve part of this, by placing the following code:
<form method="get" action="http://pathtomagento/catalogsearch/result/" id="search_mini_form">
<div class="form-search">
<label for="search">Buscar:</label>
<input type="text" class="input-text" value="" name="q" id="search" autocomplete="off">
<button class="button" title="Buscar" type="submit"><span><span>Buscar</span></span></button>
<div class="search-autocomplete" id="search_autocomplete" style="display: none;"></div>
<script type="text/javascript">
//<![CDATA[
var searchForm = new Varien.searchForm('search_mini_form', 'search', 'Buscar en el catálogo...');
searchForm.initAutocomplete('http://pathtomagento/catalogsearch/ajax/suggest/', 'search_autocomplete');
//]]>
</script>
</div>
The autocomplete function of the search box doesn't work, which is a main issue for me since it's a really useful feature. My main website is full of jQuery, and I know Magento uses prototype. So I managed to include the following scripts that seem to be required by the autocomplete Magento search box:
<script type="text/javascript" src="pathtomagento/js/prototype/prototype.js"></script>
<script type="text/javascript" src="pathtomagento/js/varien/js.js"></script>
Still no luck! I don't get any Console errors in Firebug, but I don't get any AJAX or autocomplete response either. Does anyone know what I could be missing?
Your magento installation has to be on the same server because you can't make crossdomain AJAX requests. Maybe that is the problem in your case?

Resources