Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7763067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:34:18+00:00 2026-06-01T14:34:18+00:00

I tried to add a facebook share link to a jekyll bootstrap page, however

  • 0

I tried to add a facebook share link to a jekyll bootstrap page, however when adding the href that FB will use in the share I used {{ HOME_PATH }}. This turns out to be the relative path of /, however (which FB does not understand). Does anybody know how to get the absolute path without having to hard-code it?

Code that gives a /

<a name="fb_share" type="button"
           share_url="{{ HOME_PATH }}">Share this event on Facebook</a>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T14:34:20+00:00Added an answer on June 1, 2026 at 2:34 pm

    Unfortunately, not via Jekyll. Jekyll is a static site generator, when it runs, it generates the whole site as HTML/CSS/etc pages, no server-side dynamic content.

    However, there are solutions: hard-code the url, but only in one place so it is easy to change; or, use javascript to set it appropriately client-side.

    Pure Jekyll/Liquid

    Add a line like

    host: example.com
    

    to _config.yml, and then refer to it like

    <a name="fb_share" type="button"
               share_url="http://{{ site.host }}/blah">Share this event on Facebook</a>
    

    Javascript

    If you are using jQuery, put this somewhere in your start-up scripts (obviously you can do this without jQuery, but this illustrates the technique):

    $('[name=fb_share]').each(function() {
        var $this = $(this);
        $this.attr('share_url', 
                   $this.attr('share_url').replace('HOME_PATH', 
                                                   document.location.host));
    }
    

    and have the page like

    <a name="fb_share" type="button"
               share_url="http://HOME_PATH/blah">Share this event on Facebook</a>
    

    (The JS solution may require some trickery (like delaying loading the Facebook JS) depending on when/how the scripts provided by Facebook run.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello i want to add the facebook like button in colorbox windows i tried
So I'm just trying to add some social networking share links (facebook, g+, addthis
I'm trying to add a create Facebook event functionality to my application that uses
I have a web app that is being hit by facebook. The login page
how to add Facebook, Google+ and twitter like/share button on my website, to sharing
I tried some add to favorties JavaScript scripts.. With IE8, I get an access
I tried to add buttons, textboxes and text to tableview. I want the row
I tried to add a merge strategy to my .gitattributes file in my repository.
I've tried the add() method but nothing is displayed when I try to add
When I tried to add a new node to current replica set, the current

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.