SEO plugin doesn't work in Hippo CMS - seo

I'm using Hippo CMS and trying to implement SEO plugin. I did everything by manual but I don't see any changes and meta tags in rendered results.
My basic layout is:
<#include "/WEB-INF/freemarker/include/imports.ftl">
<html lang="en">
<head>
<meta charset="utf-8"/>
<#hst.headContributions/>
<link rel="stylesheet" href="<#hst.link path="/css/bootstrap.css"/>" type="text/css"/>
<#hst.defineObjects/>
<#if hstRequest.requestContext.cmsRequest>
<link rel="stylesheet" href="<#hst.link path="/css/cms-request.css"/>" type="text/css"/>
</#if>
</head>
And I just enable plugin over Hippo Setup -> features. And sure then rebuild and run all again.
Then I'm going to Channel Editor -> Edit Page -> Add Component. The drag n drop component on page.
I did all changes by clicking on component. But anyway I don't see any changes on published page.
I didn't find any documentation about that, but maybe somebody resolve this issue and can help to me!
Thanks

I tried it out as well. It indeed does not work out of the box as you would expect. The component uses a template specific of the Setup feature, the seo.ftl. This makes it work as a draggable component in the channel manager. What it does not do is add the configured data to the html head.
If you check the seohelper.ftl [1] of the forge plugin, there you see the code that does this job. What you can do to make it work in your project is add the headcontribution tags as in [1] to seo.ftl. Also make sure you have a <#hst.headcontributions/> tag in the html head section of the base-layout.ftl of your project.
I will create a jira issue for this so.
[1] http://forge.onehippo.org/gf/project/hst-seo-support/scmsvn/?action=browse&path=%2Fcheckout%2Fhst-seo-support%2Fbranches%2Fhst-seo-support-1.01.xx%2Fsrc%2Fmain%2Fjava%2Forg%2Fonehippo%2Fforge%2Fseo%2Fsupport%2Fseohelper.ftl&revision=157

Related

I want to use Vue 3 without build and without CDN

https://v3.vuejs.org/guide/installation.html#download-and-self-host
https://v3.vuejs.org/guide/installation.html#from-cdn-or-without-a-bundler
how do I import vue without CDN?
so what I care about is not having a build step. everything in pure human-legible js.
I found this https://github.com/maoberlehner/goodbye-webpack-building-vue-applications-without-webpack
I'm going to try and implement it inside unity Embedded browser https://assetstore.unity.com/packages/tools/gui/embedded-browser-55459
the challenge is that my interface cannot load things from the web and it can't be compiled.
Create index.html
index.html (using Vue 3 - important!)
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Minimalistic Vue JS</title>
<script type="text/javascript" src="./vue.global.prod.js"></script>
</head>
<body>
<div id="app">
{{ message }}
</div>
</body>
<script>
var app = Vue.createApp({
data() {
return {
message: "Hello world"
}
}
})
app.mount("#app")
</script>
</html>
Download vue.global.prod.js from https://unpkg.com/browse/vue#3.0.11/dist/vue.global.prod.js and save it along index.html
Open index.html in browser
Works just fine in Chrome or Firefox.
Notes
for the record my code is the repo I linked plus the vue libraries I downloaded and added in the root
Note: following is related to the repo linked before question was changed
The code in repo is written for Vue 2 (just try to open https://unpkg.com/vue in the browser). So if you downloaded distros for Vue 3 (for example the link I'm using above) the code from repo will not work
Even if you download Vue 2 version, the code in the repo will not work when opened from file system as it is using native ES6 modules - problem I described in the previous version of my answer:
As described here and here ES6 modules are always loaded with CORS. So just opening the index.html in the browser (without using server) will not work (definitely does not work in Chrome). Maybe Unity Embeded Browser has this restrictions weakened (as it's purpose is to be embeded) but without possibility to use desktop browser to develop and test your app, your experience will be terrible. I would reconsider the decision not to use bundler...
Update 1
Building Vue.js Applications Without webpack (sample project) will not help you either as it is again using native ES6 modules
To use Vue as a module from a local installation, you don't want to explicitly include it in a script tag in your page. Instead, import it in the scripts that use it. The whole idea of modules is that you can import them which makes explicitly including them in your page obsolete.
In https://bitbucket.org/letsdebugit/minimalistic-vue/src/master/index.js, import Vue:
import * as Vue from "./local/path/to/vue.esm-browser.prod.js";

onclick in Core 3.1 Blazor app doesn't work

I just installed Visual Studio 2019 (v16.4.3, immediately updated to 16.4.4). I have VS2017 on my system, but no prior versions of VS2019.
I created a new Blazor app project. It automatically created Index, Counter, and other pages. It created it as a .NET Core 3.1 app (as 3.1 is now installed automatically with VS2019 v16.4 and later, apparently).
I am literally following this "Get started" page:
https://learn.microsoft.com/en-us/aspnet/core/blazor/get-started?view=aspnetcore-3.1&tabs=visual-studio
I run the app with no changes from what was generated. Clicking the button on the Counter page does nothing. I don't see any messages in the Debug Output window that have any relations.
I did some searches and found reports of similar issues but the solutions don't seem to apply.
Any idea what is wrong? (it is SO annoying when a freshly generated, unmodified project does not work!)
The code for the Counter page was generated as:
#page "/counter"
<h1>Counter</h1>
<p>Current count: #currentCount</p>
<button class="btn btn-primary" #onclick="IncrementCount">Click me</button>
#code {
private int currentCount = 0;
private void IncrementCount()
{
currentCount++;
}
}
_Host.cshtml is:
#page "/"
#namespace ToDoList.Pages
#addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
#{
Layout = null;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ToDoList</title>
<base href="~/" />
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
<link href="css/site.css" rel="stylesheet" />
</head>
<body>
<app>
<component type="typeof(App)" render-mode="ServerPrerendered" />
</app>
<div id="blazor-error-ui">
<environment include="Staging,Production">
An error has occurred. This application may no longer respond until reloaded.
</environment>
<environment include="Development">
An unhandled exception has occurred. See browser dev tools for details.
</environment>
Reload
<a class="dismiss">🗙</a>
</div>
<script src="_framework/blazor.server.js"></script>
</body>
</html>
Update:
Per comment suggestions:
I rebooted my computer
Went straight into VS2019 and created a New Project. Selected Blazor App. Accepted all defaults. So, ended up with a project named BlazorApp1.
Hit F5 to start it up. Same results. Clicking the 'Click me' button the Counter does not do anything.
Entire contents of BlazorApp1.csproj:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
</Project>
Note that the Get Started link I am following specifically says to use .NET Core 3.1 (vs 2.1). It says to OPTIONALLY update to the 3.2 preview, but that's only needed if I want to do a Blazor WebAssembly (which I don't). I prefer to only have released code on my system, so I don't want to updated to 3.2 Preview for something that is supposed to work with 3.1.
VS2019 defaulted to launching the app in Internet Explorer.
I changed it to launch it in Edge. It works in Edge.
Final update:
I got it to work in IE11. To do so:
I downloaded the Daddoon Blazor Polyfill package from here:
https://github.com/Daddoon/Blazor.Polyfill
From the downloaded zip, I copied Publish\Blazor.Polyfill.Publish\blazor.polyfill.min.js to a subfolder that I created, named "js", under the wwwroot subfolder in my project folder. I.e. in ToDoList\wwwroot, I created a subfolder named 'js' and then copied the blazor.polyfill.min.js file into that subfolder.
Then, I edited the file _Host.cshtml. I added the first line here (in front of the second line, which was already there, generated by VS and the Blazor Server template):
<script src="js/blazor.polyfill.min.js"></script>
<script src="_framework/blazor.server.js"></script>
I found a bunch of things that said "use Polyfills", but I couldn't find anything that said "here is how you actually do that." So, hopefully this helps someone else. Also, if I did something in a way that is suboptimal, hopefully someone will see this and tell me how to do it in a better way.
I had the same problem
To solve it, go to your project's Properties >> Debug >> uncheck Enable SSL. Then run your project by clicking e.g. IIS Express.

Import CSS using <link> tag in index.html Vuejs 2

I'm trying to include css file in index.html of vue2 app using link tag in head section.
It shows the call in inspect element network tab but response is blank. And the style is not applied in DOM.
When I import it in App.Vue using import syntax, it included successfully.
Can anyone tell why it does not apply form index.html?
VueJS, is not loving <link>..
you should use
<style src="your/path/css/maradona.css"></style>
but if you insists just keep mine in /static/.
<link rel="stylesheet" type="text/css" href="/static/youKnow.css">

Vue Devtools not working locally

Vue Devtools works on all demos/examples online but not on my local pages. Even with the following, the Vue Devtools icon remains gray ("Vue.js not detected"). Why?
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
</head>
<body>
<div id="app"></div>
<script>
Vue.config.devtools = true;
</script>
</body>
</html>
The Vue source you are using there looks to be minimized / production build to me. You need to use the non minimized / non-production build. Try https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.15/vue.js instead.
Also if you are working with local files i.e. accessing a page like file://... then "you need to check "Allow access to file URLs" for this extension in Chrome's extension management panel." see https://github.com/vuejs/vue-devtools
You must add at-least 1 instance of vue, for the devtools to detect it. So, do:
new Vue({el: '#app'})
You can try to refresh the browser first.
If didn't work, make sure that if you're compiling CSS and JavaScript to have have development compilation for both not a compilation for production with minified files
If at least one file is minified for prod, devtools will not show up

Unable to inject javascript with Swashbuckle/Swagger

I'm using the Swashbuckle NuGet package to create Swagger documentation for my API. https://www.nuget.org/packages/Swashbuckle
I'm trying to make some minor changes to the UI - essentially just to add some corporate branding to the header.
I have added two files as embedded resources to my project, in a directory called resources.
These are injected into the UI via:
.EnableSwaggerUi(c =>
{
c.InjectStylesheet(thisAssembly, typeof(SwaggerConfig).Namespace + ".Resources.Swagger.css");
c.InjectJavaScript(thisAssembly, typeof(SwaggerConfig).Namespace + ".Resources.Swagger.js");
}
Which results in the following link being added to rendered page.
<link href="ext/ang_nav_api-Resources-Swagger-css" rel="stylesheet" type="text/css" media="screen">
This is all correct and the stylesheet works as expected.
However the .js script doesn't appear on the client.
Changing the c.InjectJavaScript to c.InjectStylesheet does inject the file as a <link> .. so I'm happy that the file itself is correctly embedded etc.
What could be wrong here?
The .js script will not appear on the client. (not on the way you would expect)
Look closely to the code of index.html:
https://github.com/domaindrivendev/Swashbuckle/blob/8223bedae706fec612c98ebbcee6b2d7033ae349/Swashbuckle.Core/SwaggerUi/CustomAssets/index.html#L98
Your customScripts will be loaded dynamically on the onComplete event
$.getScript(script);