Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat): SEO: Add frontpage meta keywords tags based on all articles #556

Closed
wants to merge 1 commit into from

Conversation

iranzo
Copy link
Member

@iranzo iranzo commented Jan 20, 2020

Signed-off-by: Pablo Iranzo Gómez Pablo.Iranzo@gmail.com

Prerequisites

Recommended Steps

  • My patch adds a new feature, therefore I have also added a help article about it
  • My patch changes Elegant behavior, therefore I have updated the help article to reflect this change
  • My commits are signed

Description

This adds meta tags for content and keywords plus the default icon for main page of website

Closes #505

@iranzo iranzo force-pushed the metafrontpage branch 3 times, most recently from ed1823b to e493914 Compare Jan 22, 2020
@iranzo
Copy link
Member Author

iranzo commented Jan 22, 2020

Ok, as SITE_DESCRIPTION is already on NEXT no need to document afaik, it just fills in the extra headers and that's all.

Copy link
Member

@talha131 talha131 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides other changes that I have pointed out, can you please reword your commit to something less cryptic. Each feat commit goes into the release notes.

THANKS.md Show resolved Hide resolved
templates/base.html Outdated Show resolved Hide resolved
templates/index.html Outdated Show resolved Hide resolved
@iranzo iranzo force-pushed the metafrontpage branch 4 times, most recently from 316a6a2 to e7b123e Compare Jan 22, 2020
@iranzo iranzo changed the title (feat): Add base.html meta tags for frontpage (feat): SEO: Add frontpage meta keywords tags based on all articles Jan 22, 2020
@iranzo iranzo requested a review from talha131 Jan 22, 2020
Copy link
Member

@talha131 talha131 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your cooperation. A little more changes are required.

templates/index.html Outdated Show resolved Hide resolved
templates/index.html Outdated Show resolved Hide resolved
@@ -21,9 +21,21 @@
<meta name="author" content="{{ AUTHOR }}" />
{% endif %}

{% if article and article.featured_image %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest moving out this patch from base.html to smo_metadata file and then include it in the base.html

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How should I include it on base so that it works with all elements (article, page, landing etc ? )

@iranzo iranzo force-pushed the metafrontpage branch 2 times, most recently from 57500c0 to 7d6dba6 Compare Jan 22, 2020
@iranzo
Copy link
Member Author

iranzo commented Jan 22, 2020

Also, there are different descriptions for different pages:

archives.html:<meta property="og:description" content="Full archives of {{ SITENAME|striptags|e }} blog" />
archives.html:<meta name="twitter:description" content="Full archives of {{ SITENAME|striptags|e }} blog">
base.html:        <meta name="description" content="{% block head_description %}{{ SITE_DESCRIPTION|e }}{% endblock head_description %}" />
base.html:        <meta name="twitter:description" content="{% block head_description %}{{ SITE_DESCRIPTION|e }}{% endblock head_description %}">
categories.html:<meta property="og:description" content="All categories of the {{ SITENAME|striptags|e }} blog" />
categories.html:<meta name="twitter:description" content="All categories of the {{ SITENAME|striptags|e }} blog">
search.html:<meta property="og:description" content="Search results for {{ SITENAME|striptags|e }} blog" />
search.html:<meta name="twitter:description" content="Search results for {{ SITENAME|striptags|e }} blog">
tags.html:<meta property="og:description" content="All tags used in the {{ SITENAME|striptags|e }} blog" />
tags.html:<meta name="twitter:description" content="All tags used in the {{ SITENAME|striptags|e }} blog">

Not sure on what whould be the preferred approach here

@iranzo iranzo force-pushed the metafrontpage branch 2 times, most recently from 532177d to 6105742 Compare Jan 22, 2020
Signed-off-by: Pablo Iranzo Gómez <Pablo.Iranzo@gmail.com>
@iranzo
Copy link
Member Author

iranzo commented Jan 22, 2020

As I had no clear idea on how to use the macro with page, I've simplified this to cover the issue: add the tags for meta on frontpage, covered duplicated and added a missing twitter description.

We can cover the use the smo_template on another issue/pr but I'll need assistance there

templates/index.html Show resolved Hide resolved
talha131 added a commit that referenced this pull request Jan 23, 2020
@talha131
Copy link
Member

I have merged this PR manually.

@iranzo Please review this commit 28bcb85

  1. Let me know if you have any question.
  2. Your idea of using head_description2 was not going to work. User would have end up with two twitter:description
  3. Let me know if my patch does what you were gunning for.

@talha131 talha131 closed this Jan 23, 2020
@iranzo
Copy link
Member Author

iranzo commented Jan 23, 2020

Hi @talha131 the 'head_description' was to deal with the block for the twitter one and avoid issue with two blocks with same name

talha131 pushed a commit that referenced this pull request Feb 3, 2020
# [5.2.0](V5.1.0...V5.2.0) (2020-02-03)

### Bug Fixes

* regression introduced due to cache busting ([b953a38](b953a38))
* **archives:** at smaller screen layout does not make the best use of available space ([a289e9d](a289e9d))
* **syntax:** code blocks with line numbers do not have the correct border radius ([3a34a3e](3a34a3e))
* **syntax:** improve the font size and height of download button ([07595b3](07595b3))
* **typography:** fix font size and style of TOC ([2d597ab](2d597ab)), closes [#509](#509)
* Categories and Tags pages do not have space below the header ([d78f4e5](d78f4e5))
* remove invalid CSS rule ([368cb2c](368cb2c))
* use consistent color for border ([c85b7b8](c85b7b8))
* use darker color for the site name ([19f37ca](19f37ca))
* **article:** use loclate_date attribute instead of hardcoding the date format ([1da552c](1da552c)), closes [#552](#552)
* **bootstrap:** WIP. add Bootstrapv2.3.2 sources file to the project ([43ee8eb](43ee8eb)), closes [#429](#429)
* **seo:** regression introduced in PR [#556](#556) ([28bcb85](28bcb85)), closes [#505](#505)
* **typography:** about me and my projects heading is not on one line ([6a7989c](6a7989c))
* **typography:** font size of superscript number in categories and tags page ([d0a7162](d0a7162))
* **typography:** override Bootstrap base font ([f6a83a6](f6a83a6)), closes [#429](#429)
* **typography:** top menu bar does not have correct height ([d30ce82](d30ce82))
* **typography:** use consistent font and color for project list ([477a467](477a467))
* **typography:** use consistent font in the footer ([eeb0e30](eeb0e30))

### Features

* add support cache busting ([cde0dc5](cde0dc5))
* **categories:** change background color of uncollapsed Category ([6cc11b8](6cc11b8))
* **gallery:** add support for PhotoSwipe image gallery using raw HTML ([ad1bcea](ad1bcea)), closes [#567](#567)
* **js:** combine and minify all JS files into one to improve load speed ([f5047d4](f5047d4))
* **search:** improve search results page look ([73fa743](73fa743)), closes [#573](#573) [#275](#275)
* **search:** replace tipue_search with lunr.js ([9d60af1](9d60af1)), closes [#275](#275)
* **SEO:** Add header and documentation for Claiming Website on Yandex ([2bb691d](2bb691d))
* **SEO:** add SEO and SMO meta keywords in site's home page ([c5be0eb](c5be0eb))
* **sharing:** Enable customizing the sharing links ([f3e262f](f3e262f))
* **syntax:** add copy to clipboard button for every code snippet ([6f73317](6f73317)), closes [#574](#574) [#525](#525)
* **syntax:** add support for highlighting lines in code snippets ([ba2de8c](ba2de8c)), closes [#520](#520)
* **syntax:** add support for liquid_tags.include_code plugin ([0550a3a](0550a3a)), closes [#518](#518)
* **syntax:** use Gruvbox syntax highlighting theme ([0b50ab1](0b50ab1))
* **typography:** use consistent fonts ([8b7a8bd](8b7a8bd)), closes [#429](#429)
* **typography:** use consistent style for timestamps in tags, categories and archives pages ([a421dcd](a421dcd))
* **typography:** use dns-prefetch and preconnect to improve font load time ([e4bd582](e4bd582))
* **typography:** use responsive fonts ([39acdbf](39acdbf))
@iranzo iranzo deleted the metafrontpage branch Sep 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants