I do not understand partials - hugo

My wordpress site was hacked three weeks ago and I switched to hugo. My website is almost done, except for two details: Google Analytics and share buttons.
I searched the internet for the answers to my problems. However, I cannot make them work. Take the share buttons for instance. I found this tutorial that says that I need to put two files (addthis.html and addthis-script.html) in layouts/partials. I put these two files there. I edited my config.toml file with my Add-This details as well.
But I cannot make these share buttons appear in my blog posts! I edited layouts/_default/single.html with
{{ partial "addthis" . }}
{{ partial "addthis-script" . }}
right before
{{- partial "tags.html" . -}}
and nothing happens. I know I'm doing something wrong, but I cannot figure out what is.
The same goes for Google Analytics. I have no idea where I can put the partial to make it register my site visitors.
If it is important, I am using ananke theme.

Related

How can I create a deeper level of detail page for single list content in HUGO

I’m building our job posting pages with Hugo. So we will have a “Join Us” section with the list of job postings there and then we will need a detailed page for each job post, something like /join/software_engineer/. Hugo works well for this part, I created a section page template and single page template, with all the job posts in the content folder.
But now we need a deeper level of the detail page, like /join/software_engineer/submit/ to submit the resume and other info. The detail page may look very similar for every job post and will need some info from the single list content and a structured URL. Is there any way I can achieve this in a “HUGO way”? (Right now I’m coding the submit section with a modal, but still very curious if this kind of detail page is achievable.)
Any suggestions? Thank you in advance :).
if you like to go deeper your last folder needs to have an _index.md file (note the underscore). Then set the type in your frontmatter and create a custom layout e.g.
type: software_engineer
layouts/software_engineer/list.html
I have a site where I go many levels deep and that works well.

AngularJS application problems appearance in Google search

I have a personal project which consumes my free time and effort for about a year without significant profit. I have problems with it appearance in Google and would really appreciate to get help here.
This project (http://yuppi.com.ua - similar to craiglist in US) is WEB-based AngularJS 1.2 application that uses PHP rest API hosted on GoDaddy. And in order to make this application popular it have to be very visible in internet and very searchable in Google and users have to be able to share pages via social networks or skype.
According to Google specification, google crawlers doesn't run javascript to get content of a web page before index, so I've added _escaped_fragment_ page that displays content of web page without javascript. For example:
Page: http://yuppi.com.ua/#!/items/sub/18/_
Dirty : yuppi.com.ua/?_escaped_fragment_=/items/sub/18/_
This dirty page will be redirected here where google will see content.
http://yuppi.com.ua/server/crawler_proxy/routee.php?path=/items/sub/18/
So basically I have two versions on HTML file for that page. One version is the one that available to users, which has styles, a lot more HTML tags etc. And the second is the version for Google crawler - very light-weight without any styles. And I am expecting to see clean link to my site in Google, not dirty.
So, If to search all links to a web site in Google you will see that one of the links displays it's "dirty" state.
Another problem is sharing links in Skype.
When I send a link to someone, I am expecting that this link will be transformed to thumbnail image but it is not happens. Instead I see ungly link to my web site.
Please help me to understand how to make happy everyone: users, google crawler, GoDaddy and me.
I was encountering the same problems last year with a big project and we ended to use : https://prerender.io/.
It's a prerendering system that work with a phantomjs browser to detect bot request and render a full html template. It does also instanciate a cache service to not render again a template that haven't change.
Hope it help's.

Weird Content of Facebook share/like button preview from angular app

I have an issue with share/like button from Angular app. I finally made it working correctly with links but share/like preview if completely wrong. I tried XFBML.parse(), switching to html 5 mode, etc.
There are two complete enigmas:
1. I got "Given URL is not allowed by the Application configuration..." despite adding all possible variants to fb app setting.
When share preview appear - it has "Angular", but I never added it anywhere.
Here is the link
Would be grateful for any ideas...
Thx
The Facebook Scraper only looks at the HTML code your server delivers, it does not execute any JavaScript.
So if you want to share different articles, you need an individual URL for each article, that delivers the relevant meta data when requested from the server.
You can find some more explanation and hints on how to implement this in this article, http://www.michaelbromley.co.uk/blog/171/enable-rich-social-sharing-in-your-angularjs-app

Using a custom domain on GAE. Won't let me past Step 4

I'm trying to use a custom domain with a static site hosted on AppEngine. Once I get into Google Apps to add the domain, I just get stuck on this page. Basically, I can't get past Step 4 as per the instructions here. I click "Accept" and hit the activate button but the page just refreshes. I spent about a half hour on the phone with "Lewis" from Google phone support and he eventually told me to try App Engine support lol. During the support call we attempted to get this to work multiple times using both the latest Chrome and FF browsers with cookies/cache, etc. cleared.
No reputation, so no screenshot but like I said, the problem is at Step 4 where you have to accept GAE's terms.
Looks like similar problem here. Anyone have the same problem and/or know of a solution? Thanks
You can try other way to activate, like a html page.
I have used this method to activate.
My activated page seems those:
By html to activate => //i.stack.imgur.com/t3nM1.png ;
By operators to activate =>//i.stack.imgur.com/fZTWH.png;
Can you see them?
By the way, I am in China, so, these uploaded images that I can not see them.

Silverlight page with multiple page names in google analytics

I'm using Google Analytics to track traffic on my Silverlight page.
The same pages in my app are showing up under different names in the top content page.
For example, I have /Home with the most pageviews, then /ClientBin/???.xap/Home with fewer pageviews and then /Default.aspx/Home with even fewer pageviews.
It's the same with other pages (/ManageUsers, /ClientBin/???.xap/Manageusers, /Default.aspx/Manageusers) and so on.
The pageviews are different, so we can't just add them together since we are not sure why this is happening.
I know you can set a default homepage to account for differences in say / and /index.html, but that does't cover all our cases.
What I need to know is why does this happen? Can we just add them together or are some of them a subset of others?
Some of our users are using Out-of-browser, does that count as one of those three pages or is it mixed in with the others?
With some testing using Fiddler I think I've come to a conclusion.
The /ClientBin/???.xap/Home and similar pages are from
Out-of-browser.
The /Default.aspx/Home and similar pages are from
when you run the site from Visual Studio (debugging).
The /Home and similar pages are when the site is accessed on the server.
So in our example we add together the /Home and /ClientBin/???.xap/Home visit numbers to get the real numbers (ignore /Default.aspx/...).

Resources