Replace site.url with site.baseurl

I can now use `jekyll serve` and go to localhost:4000/Shuffle to see
the site and use relative links. This way it doesn't have to change
every time going from dev to production.
`jekyll serve --baseurl ""` also works to serve directly from localhost
without a subdirectory.
pull/56/head
Glen Cheney 11 years ago
parent e381e16b0f
commit fe6b965013

@ -9,7 +9,8 @@ permalink: /:title
# url: http://glen.local:4000
# url: http://localhost:4000
url: http://vestride.github.io/Shuffle
# url: http://vestride.github.io/Shuffle
baseurl: /Shuffle
defaultTitle: 'Shuffle.js'
defaultDescription: 'Categorize, sort, and filter a responsive grid of items'

@ -24,4 +24,4 @@ $('.js-shuffle-search').on('keyup change', function() {
});
});</code></pre>
<p>For another example of advanced filters, check out the <a href="{{ site.url }}/{% post_url demos/2013-05-02-adaptive %}">compounded filters demo</a>.</p>
<p>For another example of advanced filters, check out the <a href="{{ site.baseurl }}{% post_url demos/2013-05-02-adaptive %}">compounded filters demo</a>.</p>

@ -13,8 +13,8 @@
<meta property="og:title" content="{{ page.title }}" />
<meta property="og:description" content="{{ description }}" />
<meta property="og:type" content="website" />
<meta property="og:url" content="{{ site.url }}{{ page.url }}" />
<meta property="og:image" content="{{ site.url }}{{ image }}" />
<meta property="og:url" content="{{ site.baseurl }}{{ page.url }}" />
<meta property="og:image" content="{{ site.baseurl }}{{ image }}" />
<meta property="og:site_name" content="" />
<meta property="fb:admins" content="771347349" />
<meta name="author" content="https://plus.google.com/u/0/100210640453700033824" />
@ -22,7 +22,7 @@
<meta name="twitter:creator" content="@Vestride">
<meta name="twitter:title" content="{{ page.title }}">
<meta name="twitter:description" content="{{ description }}">
<meta name="twitter:image" content="{{ site.url }}{{ image }}">
<meta name="twitter:image" content="{{ site.baseurl }}{{ image }}">
<link href="https://plus.google.com/u/0/100210640453700033824" rel="author" />
@ -35,18 +35,18 @@
<link rel="dns-prefetch" href="//www.google-analytics.com">
<link rel="dns-prefetch" href="//ajax.googleapis.com">
{% if page.prism %}<link rel="stylesheet" href="{{ site.url }}/css/prism.css" />{% endif %}
<link rel="stylesheet" href="{{ site.url }}/css/style.css" />
<link rel="stylesheet" href="{{ site.url }}/css/shuffle-styles.css" />
{% if page.prism %}<link rel="stylesheet" href="{{ site.baseurl }}/css/prism.css" />{% endif %}
<link rel="stylesheet" href="{{ site.baseurl }}/css/style.css" />
<link rel="stylesheet" href="{{ site.baseurl }}/css/shuffle-styles.css" />
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Ubuntu:300,400,700">
{% if page.extraCSS %}
{% for href in page.extraCSS %}
<link rel="stylesheet" href="{{ site.url }}{{ href }}" />
<link rel="stylesheet" href="{{ site.baseurl }}{{ href }}" />
{% endfor %}
{% endif %}
<!--[if lt IE 9]>
<script src="{{ site.url }}/js/html5shiv.js"></script>
<script src="{{ site.baseurl }}/js/html5shiv.js"></script>
<![endif]-->
</head>
<body class="{{ page.bodyClass }}">

@ -7,7 +7,7 @@
<h3 class="site-nav__title">Shuffle.js</h3>
<div class="row-fluid">
<div class="span3">
<a class="btn btn--primary" href="{{ site.url }}/">Home</a>
<a class="btn btn--primary" href="{{ site.baseurl }}/">Home</a>
</div>
<div class="span3">
<a class="btn btn--primary" href="https://github.com/Vestride/Shuffle">GitHub Repo</a>
@ -16,7 +16,7 @@
<a class="btn btn--primary" href="https://twitter.com/Vestride">By @Vestride</a>
</div>
<div class="span3">
<a class="btn btn--primary" href="{{ site.url }}/faq">FAQ</a>
<a class="btn btn--primary" href="{{ site.baseurl }}/faq">FAQ</a>
</div>
</div>
@ -24,10 +24,10 @@
<div class="row-fluid m-row js-demos site-nav__demos">
{% for post in site.demos %}
<div class="span3 m-span3 figure-wrap js-demo">
<a href="{{ site.url }}/{{ post.slug }}">
<a href="{{ site.baseurl }}/{{ post.slug }}">
<figure>
<div class="keep-ratio four-three">
<img src="{{ site.url }}/img/demos/{{ post.slug }}.webp" alt="{{ post.label }}" />
<img src="{{ site.baseurl }}/img/demos/{{ post.slug }}.webp" alt="{{ post.label }}" />
</div>
<figcaption>{{ post.label }}</figcaption>
</figure>

@ -7,9 +7,9 @@
{% endif %}
{% if item.cols %}{% assign cols = item.cols %}{% else %}{% assign cols = 3 %}{% endif %}
<figure class="span{{ cols }} m-span3 picture-item{{ extras }}" data-groups='{{ groups }}' data-date-created="{{ item.date }}" data-title="{{ item.title }}">
<img src="{{ site.url }}/img/{{ item.img }}" alt="" height="145" width="230" />
<img src="{{ site.baseurl }}/img/{{ item.img }}" alt="" height="145" width="230" />
<div class="picture-item__details clearfix">
<figcaption class="picture-item__title pull-left"><a href="{{ site.url }}/img/originals/{{ item.original }}" target="_blank">{{ item.title }}</a></figcaption>
<figcaption class="picture-item__title pull-left"><a href="{{ site.baseurl }}/img/originals/{{ item.original }}" target="_blank">{{ item.title }}</a></figcaption>
<p class="picture-item__tags pull-right">{{ item.groups | join: ', ' }}</p>
</div>
{% if item.description %}<p class="picture-item__description">{{ item.description }}</p>{% endif %}

@ -6,18 +6,18 @@
<!--<![endif]-->
<!-- Shuffle! -->
<script src="{{ site.url }}/jquery.shuffle.js"></script>
<script src="{{ site.baseurl }}/jquery.shuffle.js"></script>
{% if page.prism %}
<!-- Syntax highlighting via Prism -->
<script src="{{ site.url }}/js/prism.js"></script>
<script src="{{ site.baseurl }}/js/prism.js"></script>
{% endif %}
<script>var site_url = "{{ site.url }}";</script>
<script src="{{ site.url }}/js/page.js"></script>
<script>var site_url = "{{ site.baseurl }}";</script>
<script src="{{ site.baseurl }}/js/page.js"></script>
{% if page.extraJS && page.extraJS.length %}
{% for src in page.extraJS %}
<script src="{{ site.url }}/js/{{ src }}"></script>
<script src="{{ site.baseurl }}/js/{{ src }}"></script>
{% endfor %}
{% endif %}

@ -41,7 +41,7 @@
<h3 id="columns">How column widths work</h3>
<p>The <code>columnWidth</code> option is used to calculate the column width. You have several options:</p>
<ol>
<li>Use a <strong>sizer</strong> element. This is the easest way to specify column and gutter widths. You can use an element or an element wrapped in jQuery. The column and gutter widths will be measured using this element. The <code>sizer</code> option is an alias for <code>columnWidth</code>. See <a href="{{ site.url }}/{% post_url demos/2013-05-01-basic %}">a demo</a> using a sizer element or <a href="{{ site.url }}/js/demos/homepage.js">look at the js file</a> for the sizer demo.</li>
<li>Use a <strong>sizer</strong> element. This is the easest way to specify column and gutter widths. You can use an element or an element wrapped in jQuery. The column and gutter widths will be measured using this element. The <code>sizer</code> option is an alias for <code>columnWidth</code>. See <a href="{{ site.baseurl }}{% post_url demos/2013-05-01-basic %}">a demo</a> using a sizer element or <a href="{{ site.baseurl }}/js/demos/homepage.js">look at the js file</a> for the sizer demo.</li>
<li>Use a <strong>function</strong>. When a function is used, its first parameter will be the width of the shuffle element. You need to return the column width for shuffle to use (in pixels).</li>
<li>A <strong>number</strong>. This will explicitly set the column width to your number (in pixels).</li>
<li>By default, shuffle will use jQuery's <code class="language-javascript">outerWidth(true)</code> to calculate the column width of the first item and use that value.</li>

@ -34,7 +34,7 @@ extraJS: [ "faq.js" ]
<div class="question js-question">
<div class="question__inner">
<h3 class="question__text">Why are images overlapping?</h3>
<p class="question__answer">If the size of your items are dependent on images, they can overlap if shuffle is initialized before all the images have loaded. Check out <a href="{{ site.url }}/{% post_url demos/2013-05-03-images %}">this demo</a> to see how to fix it.</p>
<p class="question__answer">If the size of your items are dependent on images, they can overlap if shuffle is initialized before all the images have loaded. Check out <a href="{{ site.baseurl }}{% post_url demos/2013-05-03-images %}">this demo</a> to see how to fix it.</p>
</div>
</div>

@ -9,9 +9,9 @@ prism: true
<div class="container-fluid">
<h2>Images!</h2>
<p>You can encounter problems when shuffle item dimensions depend on images. <a href="{{ site.url }}/{% post_url demos/2013-06-29-image-problems %}">Like this demo</a>. There are three good solutions to this.</p>
<p>You can encounter problems when shuffle item dimensions depend on images. <a href="{{ site.baseurl }}{% post_url demos/2013-06-29-image-problems %}">Like this demo</a>. There are three good solutions to this.</p>
<ol>
<li>Set an explicit height on <code>.shuffle-item</code>s like the <a href="{{ site.url }}/{% post_url demos/2013-05-01-basic %}">basic demo</a>.</li>
<li>Set an explicit height on <code>.shuffle-item</code>s like the <a href="{{ site.baseurl }}{% post_url demos/2013-05-01-basic %}">basic demo</a>.</li>
<li>Similar to number 1, make the height of the image container a percentage of the width. This can be seen in the nav images above with the <code>div.keep-ratio</code>.</li>
<li>Get notified when images load (this page). In this case, I'm using <a href="http://desandro.github.io/imagesloaded/">Desandro's images loaded plugin</a>. Please note that imagesloaded does not support IE7.</li>
</ol>
@ -56,7 +56,7 @@ prism: true
<div class="shuffle--images row-fluid">
{% for item in site.items %}
<figure class="js-item img-item span3 m-span3">
<img src="{{ site.url }}/img/{{ item.img }}" alt="{{item.title}}"/>
<img src="{{ site.baseurl }}/img/{{ item.img }}" alt="{{item.title}}"/>
<figcaption>{{ item.groups }}</figcaption>
</figure>
{% endfor %}

@ -7,7 +7,7 @@ extraJS: [ "demos/images-broken.js"]
<div class="container-fluid">
<h2>This probably looks broken.</h2>
<p>Demo in which shuffle item dimensions are based on images without a fix. <a href="{{ site.url }}/{% post_url demos/2013-05-03-images %}">See here</a> for a solution.</p>
<p>Demo in which shuffle item dimensions are based on images without a fix. <a href="{{ site.baseurl }}{% post_url demos/2013-05-03-images %}">See here</a> for a solution.</p>
<p>Resize the window and it'll fix itself.</p>
</div>
@ -32,7 +32,7 @@ extraJS: [ "demos/images-broken.js"]
<div class="shuffle--images row-fluid">
{% for item in site.items %}
<figure class="js-item img-item span3 m-span3">
<img src="{{ site.url }}/img/{{ item.img }}" alt="{{item.title}}"/>
<img src="{{ site.baseurl }}/img/{{ item.img }}" alt="{{item.title}}"/>
<figcaption>{{ item.groups }}</figcaption>
</figure>
{% endfor %}

@ -11,8 +11,8 @@ prism: true
<h2>Downloads</h2>
<div class="row-fluid">
<nav class="span6" role="secondary">
<a href="{{ site.url }}/jquery.shuffle.js">jquery.shuffle.js</a>
<a href="{{ site.url }}/jquery.shuffle.min.js">jquery.shuffle.min.js</a>
<a href="{{ site.baseurl }}/jquery.shuffle.js">jquery.shuffle.js</a>
<a href="{{ site.baseurl }}/jquery.shuffle.min.js">jquery.shuffle.min.js</a>
</nav>
</div>
</div>

Loading…
Cancel
Save