Why does a search engine summary contain text that is not in any of the static html files? - hugo

I have a hugo site, and on a search engine (Duckduckgo), my site's summary is:
Add your own "layouts/partials/hero.html" to replace this text.
I tried looking for the string hero in the files in my public folder, can't seem to find it.
I have added this file with some content. Nothing seems to happen. Do I need to edit the theme files or something?
Edit: changed title to make problem clearer. The original question asked about "hero cards", which I thought might have been a standard search engine friendly part of a website.

I think I understand what is happening now. I originally installed the base16 theme which does contain the text:
Add your own "layouts/partials/hero.html" to replace this text.
( it is in the file themes\base16\layouts\partials\hero.html.).
I should have realised, but search engines take time to re-index a site. I originally published the site using base16 with some text unedited. Duckduckgo was showing that old text, it will probably disappear in time when the site is reindexed.

The answer is in the documentation for the base16 theme:
You probably want to edit the homepage. Get started by copying the
supplied homepage to your own site.
$ mkdir -p layouts/partials
$ cp themes/base16/layouts/partials/hero.html layouts/partials/hero.html
After this, you can edit layouts/partials/hero.html and make it
awesome.
The default layouts/partials/hero.html contains the code Add your own "<code>layouts/partials/hero.html</code>" to replace this text., which is what DuckDuckGo was using to make its summary. As you noted in your answer above, if you edit this file then the DuckDuckGo summary should change when DuckDuckGo next indexes your site.

Related

blogdown not showing plots from .Rmarkdown files but from .Rmd

I'm using blogdown to create my website. Now I found this problem:
ggplots embedded in .Rmarkdown files doesn't appear. When I rename the file to .Rmd the graphic is okay. But I need to use .Rmarkdown because I want to use the beauty syntax highlighting and other features only available in .Rmarkdown files.
When I print the fig.path with
knitr::opts_chunk$get('fig.path')
I see the difference:
In .Rmd
"2020-06-17-rmd_files/figure-html/"
In .Rmarkdown
"/post/2020-06-17-rmarkdown_files/figure-html/"
But I don't see why the paths are changed.
How do I solve this?
I found a solution (at https://discourse.gohugo.io/t/raw-html-getting-omitted-in-0-60-0/22032):
After adding
[markup.goldmark.renderer]
unsafe= true
in the config.toml the plots appear.

2sxc Adam folder list

I have a problem with listing/showing Folders created within Adam's File Library?
I have dowloaded Adam 2.0 tutorial from your site
I can't get them listed even in downloaded template and example "Another one rides the bus". If I change template view "Adam example with groups (folders) I don't see any image at all.
I tried adding #screenshots.Folders.Count but I get value 0 even there are already 2 non-empty folders created in given example gallery.
For #screenshots.Files.Count I get 4 which is correct value for a root level.
I get no other errors.
Thanks!
I'm not sure if those examples are all still current. But if you check out the latest Blueimp that may help. See https://2sxc.org/en/apps/app/blueimp-gallery-slider-4-0-with-koi-bootstrap-3-and-4.

Composite C1: how to make the page editor to display the source code by default

When you start editing a page, the editor is initially in the Visual mode, so every time you have to switch it to the Source mode if you prefer html-level editing as usually programmers do.
It is annoying when you have a lot of things to do during the day, especially when there is a bunch of languages every page is translated to.
I haven't found any option in the CMS and no solution in Google.
Actually I found myself the way to change this, so I post this question in order to instantly answer it. Maybe this will help somebody.
Edit file VisualEditorPageBinding.js, which is located in /Composite/content/misc/editors/visualeditor/bindings.
There is function VisualEditorPageBinding.prototype.initializeComponent.
Simply add this line at the very end of the function:
this.switchEditingMode();

Difficulty with filename and filemime when using Migrate module

I am using the Drupal 7 Migrate module to create a series of nodes from JPG and EPS files. I can get them to import just fine. But I notice that when I am done importing them if I look at the nodes it creates, none of the attached filefield and thumbnail files contain filename information.
Upon inspecting the file_managed table I see that both the filename and filemime fields are empty for ONLY the files that I attached via the migrate module. This also creates an issue with downloading the files.
Now I think the problem has to do with the fact that I am using "file_link" instead of "file_copy" as the file operation I specify. The problem is I am importing around 2TB (thats Terabytes) of image files. We had to put in a special request with Rackspace just to get access to that much disk space on our server. So I can't go around copying from one directory to the next because of space issues. So "file_link" seems like the obvious choice.
Now you probably want to see how I am doing this exactly, so here is the code snippet:
$jpg_arguments = MigrateFileFieldHandler::arguments(NULL,
'file_link', FILE_EXISTS_RENAME, 'en', array('source_field' => 'jpg_name'),
array('source_field' => 'jpg_filename'), array('source_field' => 'jpg_filename'));
$this->addFieldMapping('field_image', 'jpg_uri')
->arguments($jpg_arguments);
As you can see I am specifying no base path (just like the beer.inc example file does). I have set file_link, the language, and the source fields for the description, title, and alt.
It is able to generate thumbnails from the JPGs. But still missing those columns of data in the db table. I traced through the functions the best I could but I don't see what is causing this. I tried running the uri in the table through the functions that generate the filename and the filemime and they output just fine. It is like something is removing just those segments of data.
Does anyone have any idea what this could be? I am using the Drupal 7 Migrate module version 2.2. It is running on Drupal 7.8.
Thanks,
Patrick
Ok, so I have found the answer to yet another question of mine. This is actually an issue with the migrate module itself. The issue is documented here. I will be repealing this bounty (as soon as I figure out how).

How Do I Use Multiple po Files in CakePHP?

I'm just beginning the process of exploring i18n in CakePHP and I can't seem to find the right combination of files and functions that will allow me to use multiple po files. If I want to use a single po file (default.po) for every bit of translatable text, that works fine, but I see that becoming an unmaintainable hairball very, very quickly. I've read the docs and the few articles I can find, but none really dive into i18n beyond the trivial use of one .po file.
Here's where I am right now:
I've "baked" my po templates (.pot files) and copied those into app/locale/eng/LC_MESSAGES (I'm not going to be using the default text as the key so that I can easily spot missing keys). For now, I have -views-layouts-default.po and -views-pages-index.po.
In those .po files, I've entered the text I want to use for each key.
In my homepage (views/pages/index.ctp) and default layout (views/layouts/default.ctp) I've wrapped the text key I want to translate with the __() function.
When I load the homepage, though, all I see are they keys. No text has been translated. If I throw up a default.po file, though, any keys I drop in there are populated just fine. I'm clearly missing some piece of the puzzle, but I can't find it. Any help would be much appreciated.
Thanks.
I found the piece I was missing thanks to the CakePHP Google Group. I had been playing with the __d() convenience function, but didn't have a clear picture of how to tie it together to my .po files. The answer is easy once you know it:
The domain translation:
__d ( 'login', 'PLEASE_LOGIN' );
Will look for the "PLEASE_LOGIN" key in the file named login.po. I didn't know (and hadn't read anywhere) that domain == po file name (without extension). Learning that made all the difference.

Resources