1667402340
Jekyll Plugin Which Generates A Table Of Contents
Add jekyll-toc plugin in your site's Gemfile
, and run bundle install
.
gem 'jekyll-toc'
Add jekyll-toc to the gems:
section in your site's _config.yml
.
plugins:
- jekyll-toc
Set toc: true
in posts for which you want the TOC to appear.
---
layout: post
title: "Welcome to Jekyll!"
toc: true
---
There are three Liquid filters, which can be applied to HTML content, e.g. the Liquid variable content
available in Jekyll's templates.
toc
filterAdd the toc
filter to your site's {{ content }}
(e.g. _layouts/post.html
).
{{ content | toc }}
This filter places the TOC directly above the content.
If you'd like separated TOC and content, you can use {% toc %}
tag (or toc_only
filter) and inject_anchors
filter.
{% toc %}
tag / toc_only
filterGenerates the TOC itself as described below. Mostly useful in cases where the TOC should not be placed immediately above the content but at some other place of the page, i.e. an aside.
<div>
<div id="table-of-contents">
{% toc %}
</div>
<div id="markdown-content">
{{ content }}
</div>
</div>
:warning: {% toc %}
Tag Limitation
{% toc %}
works only for Jekyll Posts and Jekyll Collections. If you'd like to use {% toc %}
except posts or collections, please use toc_only
filter as described below.
<div>
<div id="table-of-contents">
{{ content | toc_only }}
</div>
<div id="markdown-content">
{{ content | inject_anchors }}
</div>
</div>
inject_anchors
filterInjects HTML anchors into the content without actually outputting the TOC itself. They are of the form:
<a class="anchor" href="#heading1-1" aria-hidden="true">
<span class="octicon octicon-link"></span>
</a>
This is only useful when the TOC itself should be placed at some other location with the toc_only
filter.
jekyll-toc generates an unordered list by default. The HTML output is as follows.
<ul id="toc" class="section-nav">
<li class="toc-entry toc-h1"><a href="#heading1">Heading.1</a>
<ul>
<li class="toc-entry toc-h2"><a href="#heading1-1">Heading.1-1</a></li>
<li class="toc-entry toc-h2"><a href="#heading1-2">Heading.1-2</a></li>
</ul>
</li>
<li class="toc-entry toc-h1"><a href="#heading2">Heading.2</a>
<ul>
<li class="toc-entry toc-h2"><a href="#heading2-1">Heading.2-1</a>
<ul>
<li class="toc-entry toc-h3"><a href="#heading2-1-1">Heading.2-1-1</a></li>
<li class="toc-entry toc-h3"><a href="#heading2-1-2">Heading.2-1-2</a></li>
</ul>
</li>
<li class="toc-entry toc-h2"><a href="#heading2-2">Heading.2-2</a></li>
</ul>
</li>
</ul>
jekyll-toc is customizable on _config.yml
.
# _config.yml
toc:
min_level: 1
max_level: 6
ordered_list: false
no_toc_section_class: no_toc_section
list_id: toc
list_class: section-nav
sublist_class: ''
item_class: toc-entry
item_prefix: toc-
# _config.yml
toc:
min_level: 2 # default: 1
max_level: 5 # default: 6
The default heading range is from <h1>
to <h6>
.
You can enable TOC by default with Front Matter Defaults:
# _config.yml
defaults:
- scope:
path: ""
values:
toc: true
The heading is ignored in the toc by adding no_toc
class.
<h1>h1</h1>
<h1 class="no_toc">This heading is ignored in the TOC</h1>
<h2>h2</h2>
The headings are ignored inside the element which has no_toc_section
class.
<h1>h1</h1>
<div class="no_toc_section">
<h2>This heading is ignored in the TOC</h2>
<h3>This heading is ignored in the TOC</h3>
</div>
<h4>h4</h4>
Which would result in only the <h1>
& <h4>
within the example being included in the TOC.
The class can be configured on _config.yml
:
# _config.yml
toc:
no_toc_section_class: exclude # default: no_toc_section
Configuring multiple classes are allowed:
# _config.yml
toc:
no_toc_section_class:
- no_toc_section
- exclude
- your_custom_skip_class_name
The toc can be modified with CSS. The sample CSS is the following.
.section-nav {
background-color: #fff;
margin: 5px 0;
padding: 10px 30px;
border: 1px solid #e8e8e8;
border-radius: 3px;
}
Each TOC li
entry has two CSS classes for further styling. The general toc-entry
is applied to all li
elements in the ul.section-nav
.
Depending on the heading level each specific entry refers to, it has a second CSS class toc-XX
, where XX
is the HTML heading tag name. For example, the TOC entry linking to a heading <h1>...</h1>
(a single #
in Markdown) will get the CSS class toc-h1
.
You can apply custom CSS classes to the generated <ul>
and <li>
tags.
# _config.yml
toc:
list_id: my-toc-id # Default: "toc"
list_class: my-list-class # Default: "section-nav"
sublist_class: my-sublist-class # Default: no class for sublists
item_class: my-item-class # Default: "toc-entry"
item_prefix: item- # Default: "toc-":
By default the table of contents will be generated as an unordered list via <ul></ul>
tags. This can be configured to use ordered lists instead <ol></ol>
. This can be configured in _config.yml
:
# _config.yml
toc:
ordered_list: true # default is false
In order to change the list type, use the list-style-type css property. Add a class to the sublist_class
configuration to append it to the ol
tags so that you can add the list-style-type
property.
Example
# _config.yml
toc:
ordered_list: true
list_class: my-list-class
sublist_class: my-sublist-class
.my-list-class {
list-style-type: upper-alpha;
}
.my-sublist-class: {
list-style-type: lower-alpha;
}
This will produce:
Author: Toshimaru
Source Code: https://github.com/toshimaru/jekyll-toc
License: MIT license
1666719480
Hydeout updates the original Hyde theme for Jekyll 3.x and 4.x and adds new functionality.
Hydeout is available as the jekyll-theme-hydeout
Ruby Gem. Add gem "jekyll-theme-hydeout", "~> 4.1"
to your Gemfile and run bundle install
.
If you're installing on Github pages, you may also have to add remote_theme: fongandrew/hydeout
to your _config.yml
. See the Github instructions for more details.
Hydeout uses pagination, so if you have an index.md
, you'll need to swap it with an index.html
that uses the index
layout:
---
layout: index
title: Home
---
You'll also need to add a setting to _config.yml
telling Jekyll how many posts to include per page (e.g. paginate: 5
).
In keeping with the original Hyde theme, Hydeout aims to keep the overall design lightweight and plugin-free. JavaScript is currently limited only to Disqus and Google Analytics (and is only loaded if you provide configuration variables).
Hydeout makes heavy use of Flexbox in its CSS. If Flexbox is not available, the CSS degrades into a single column layout.
Hydeout replaces Hyde's class-based theming with the use of the following SASS variables:
$sidebar-bg-color: #202020 !default;
$sidebar-fg-color: white !default;
$sidebar-sticky: true !default;
$layout-reverse: false !default;
$link-color: #268bd2 !default;
To override these variables, create your own assets/css/main.scss
file. Define your own variables, then import in Hydeout's SCSS, like so:
---
# Jekyll needs front matter for SCSS files
---
$sidebar-bg-color: #ac4142;
$link-color: #ac4142;
$sidebar-sticky: false;
@import "hydeout";
See the _variables file for other variables you can override.
You can see the full set of partials you can replace in the _includes
folder, but there are a few worth noting:
_includes/copyright.html
- Insert your own copyright here.
_includes/custom-head.html
- Insert custom head tags (e.g. to load your own stylesheets)
_includes/custom-foot.html
- Insert custom elements at the end of the body (e.g. for custom JS)
_includes/custom-nav-links.html
- Additional nav links to insert at the end of the list of links in the sidebar.
Pro-tip: The nav
s in the sidebar are flexboxes. Use the order
property to order your links.
_includes/custom-icon-links.html
- Additional icon links to insert at the end of the icon links at the bottom of the sidebar. You can use the order
property to re-order.
_includes/favicons.html
- Replace references to favicon.ico
and favicon.png
with your own favicons references.
_includes/font-includes.html
- The Abril Fatface font used for the site title is loaded here. If you're overriding that font in the CSS, be sure to also remove the font load reference here.
Hydeout adds a new tags page (accessible in the sidebar). Just create a new page with the tags layout:
---
layout: tags
title: Tags
---
Hydeout adds a new "category" layout for dedicated category pages. Category pages are automatically added to the sidebar. All other pages must have sidebar_link: true
in their front matter to show up in the sidebar. To create a category page, use the category
layout"
---
layout: category
title: My Category
---
Description of "My Category"
You can control how pages are sorted by using the sidebar_sort_order
parameter in the front matter. This works for both category and non-category pages, although non-category pages will always come first. Take a look at _includes/sidebar-nav-links.html
if you want to customize this behavior.
---
layout: page
title: My page
sidebar_sort_order: 123
---
Some content.
A simple redirect-to-Google search is available. Just create a page with the search
layout.
---
layout: search
title: Google Search
---
Disqus integration is ready out of the box. Just add the following to your config file:
disqus: shortname: my-disqus-shortname
If you don't want Disqus or want to use something else, override comments.html
.
For Google Analytics support, define a google_analytics
variable with your property ID in your config file.
There's also a bunch of minor tweaks and adjustments throughout the theme. Hope this works for you!
Author: Fongandrew
Source Code: https://github.com/fongandrew/hydeout
License: View license
1666671780
A (nearly) no-CSS, fast, minimalist Jekyll theme. Inspired by elly's site, expressly created for my personal blog.
If you haven't already created your blog using Jekyll, follow the instructions to do so from Jekyll's documentation.
NOTE: if you are using Jekyll with GitHub Pages, see the GitHub Pages installation section.
Then, to style your blog with this theme, add this line to your Jekyll site's Gemfile
:
gem "no-style-please"
And add this line to your Jekyll site's _config.yml
:
theme: no-style-please
And then execute:
$ bundle
Or install it yourself as:
$ gem install no-style-please
If you want to use this theme for your Jekyll's site deployed on GitHub Pages, follow the instructions on this page.
You can edit _config.yml
file to customize your blog. You can change things such as the name of the blog, the author, the appearance of the theme (light, dark or auto), how dates are formatted, etc. Customizable fields should be straightforward to understand. Still, _config.yml
contains some comments to help you understand what each field does.
For further customization (e.g. layout, CSS) see the official Jekyll's documentation on customizing gem-based themes.
In order to add/edit/delete entries from the main menu, you have to edit the menu.yml
file inside _data
folder. Through that file you can define the structure of the menu. Take a look at the default configuration to get an idea of how it works and read on for a more comprehensive explanation.
The menu.yml
file accepts the following fields:
entries
define a new unordered list that will contain menu entries-
at the beginning of the linetitle
, which defines the text to render for this menu entry (NB: you can also specify HTML!)url
, which can be used to specify an URL for this entry. If not specified, title
will be rendered as-is; otherwise title
will be sorrounded by a link tag pointing to the specified URL. Note that the URL can either be relative or absolute. Also note that you can get the same result by placing an <a>
tag in the title
field.post_list
, which can be set either to true
or to an object. If it is true, the entry will have a list of all posts as subentries. This is used to render your post list. If you want to customize which posts to render (e.g. by category), you can add one or more of the following attributes under post_list
:category
, which can be set to a string. It is used to render a list of posts of the specified category only. If you don't set it, then posts of all categories will be rendered.limit
, which can be set to a number. It specifies the number of posts to show. If not set, all posts will be rendered.show_more
, which can be true. If it is true and if the number of posts to show is greater than the specified limit
, render a link to another page. To specify the URL and the text of the link, you can set show_more_url
and show_more_text
attributes, which are documented below.show_more_url
, which can be a string. It specifies the URL for the show more link. Use only if show_more
is true. This will usually redirect to a page containing all posts, which you can easily create using an archive page (see create archive pages section)show_more_text
, which can be a string. It specifies the text for the show more link. Use only if show_more
is true.entries
, yes, you can have entries inside entries. In this way you can create nested sublists!A so-called archive page is a page that shows a list of posts (see this for an example). You can create an archive page by creating a page and putting the following frontmatter:
---
layout: archive
title: The title of the page here
which_category: name-of-category
---
which_category
is optional: if you don't put it, then all posts of the blog will be listed; on the other hand, if you specify a category, only posts of that category will be shown.
This feature is particularly useful if used together with the show_more
attribute in the menu. For example, if you want to limit the number of posts shown in the home page to 5 but add a link to view them all, then you can create an archive page using the method showed above and link to it using the show_more_url
attribute in menu.yml
. See this example if you're in doubt.
The index.md
page should use layout home
, which is the layout that displays the menu. If you want to have some content after the menu, you can just add that content in the index.md
file, and it will automatically show under the menu.
Another thing you can do to customize the index page is show the description of your blog between the title and the menu. To do this, just edit _config.yml
and change theme_config.show_description
to true
.
This theme provides dark mode by inverting all colors of light mode throught the CSS invert()
function. This approach would also invert the color of all images, but, since this is not the behaviour one would expect, images are not inverted by default.
However, if you would like to force the color inversion on a specific image you can do so by applying class="ioda"
to that image ("ioda" stands for "invert on dark appearance"). See the image in the overview post for an example of this approach. Note that color inversion will take place only when the theme has dark appearance!
For example, if you have a black and white image it could make sense to invert it in dark mode. On the other hand, a colorful image will probably look bad if inverted.
Bug reports and pull requests are welcome on GitHub at https://github.com/riggraz/no-style-please. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
To set up your environment to develop this theme, run bundle install
.
Your theme is setup just like a normal Jekyll site! To test your theme, run bundle exec jekyll serve
and open your browser at http://localhost:4000
. This starts a Jekyll server using your theme. Add pages, documents, data, etc. like normal to test your theme's contents. As you make modifications to your theme and to your content, your site will regenerate and you should see the changes in the browser after a refresh, just like normal.
When your theme is released, only the files in _layouts
, _includes
, _sass
and assets
tracked with Git will be bundled. To add a custom directory to your theme-gem, please edit the regexp in no-style-please.gemspec
accordingly.
Author: riggraz
Source Code: https://github.com/riggraz/no-style-please
License: MIT license
1665864120
A simple Ruby Gem to bootstrap dependencies for setting up and maintaining a local Jekyll environment in sync with GitHub Pages.
One may opt for the conventional approach of using the pages-gem or the containerized approach in which a Docker container is used to provide an environment with most dependencies pre-installed.
Important: Make sure you have Bundler > v1.14 by running gem update bundler
in your terminal before following the next steps.
Add the following to your project's Gemfile:
gem 'github-pages', group: :jekyll_plugins
Run bundle install
Note: You are not required to install Jekyll separately. Once the github-pages
gem is installed, you can build your site using jekyll build
, or preview your site using jekyll serve
. For more information about installing Jekyll locally, please see the GitHub Help docs on the matter.
Provided that Docker is installed, one may avoid the setup of additional tools within the environment by simply spawning a Docker container.
Run make image
from the root of the pages-gem directory to build an image which will be tagged as gh-pages
make image_alpine
for a smaller alpine
-based imageStart an instance of the server by running either:
SITE=PATH_TO_YOUR_PROJECT make server
from the root of the gh-pages
repository (where the Makefile resides) orSITE=PATH_TO_YOUR_PROJECT docker run --rm -p 4000:4000 -v `realpath ${SITE}`:/src/site gh-pages
from any directory orgithub-pages $PATH_TO_YOUR_PROJECT
from any directory when func.sh has been sourced into your terminal session orgithub-pages
from the directory of the Jekyll site to be previewed when func.sh has been sourced into your terminal session.Note: the github-pages
function may be enabled by sourcing func.sh. This can be done by appending
source $PATH_TO_THIS_DIRECTORY/contrib/func.sh
to the scripts that load on initiation of a terminal session (usually ~/.bashrc
on bash or ~/.zshrc
on zsh).:
Running of
github-pages
inside a directory of a Jekyll site spawns a server on port 4000. One may explicitly provide a path to a Jekyll site and a port by runninggithub-pages $PATH $PORT
. This approach is provided as a user-friendlier alternative to themake server
ordocker run
invocations mentioned as the first options in step 2.
The ordering of the arguments for the
github-pages
function is based on the assumption that it is more likely to need to specify a custom path rather than a custom port.
The GitHub Pages gem also comes with several command-line tools, contained within the github-pages
command.
$ bundle exec github-pages versions
+---------------------------+---------+
| Gem | Version |
+---------------------------+---------+
| jekyll | x.x.x |
| kramdown | x.x.x |
| liquid | x.x.x |
| .... | .... |
+---------------------------+---------+
Note, you can also pass the --gemfile
flag to get the dependencies listed in a valid Gemfile dependency format. You can also see a list of the live dependency versions at pages.github.com/versions.
Checks your GitHub Pages site for common DNS configuration issues.
$ github-pages health-check
Checking domain foo.invalid...
Uh oh. Looks like something's fishy: A record points to deprecated IP address
See the GitHub Pages Health Check documentation for more information.
If you'd like to run a Jekyll plugin locally that's not whitelisted for use on GitHub Pages, you can do so by prefixing the jekyll build
or jekyll serve
command with DISABLE_WHITELIST=true
. This will allow your site to use any plugin listed in your site's gems
configuration flag. Please note, however, this option is only available when previewing your Jekyll site locally.
To update to the latest version of Jekyll and associated dependencies, simply run gem update github-pages
, or if you've installed via Bundler, bundle update github-pages
.
The goal of the GitHub Pages gem is to help GitHub Pages users bootstrap and maintain a Jekyll build environment that most closely matches the GitHub Pages build environment. The GitHub Pages gem relies on explicit requirements shared between both users' computers and the build servers to ensure that the result of a user's local build is consistently also the result of the server's build.
Additional tools, such as tools that integrate with the GitHub API to make managing GitHub Pages sites easier are not the primary goal, but may be within the project's scope.
The GitHub Pages gem seeks to version two aspects of the build environment:
The version of Ruby with which Jekyll is executed. Although Jekyll itself may be compatible with prior or future versions of Ruby, different execution environments yield different results. Ruby 1.8.7 parses YAML differently than 1.9.3, for example, and Kramdown has trouble processing mailto
links prior to 1.9.3. In order to ensure that building locally consistently results in the same build as what appears when published, it's essential that Ruby itself is versioned along side the Gem, despite no known incompatibilities.
This includes Markdown processors, and any other Jekyll dependency for which version incongruency may produce unexpected results. Traditionally, Maruku, Kramdown, RedCloth, liquid, rdiscount, and redcarpet have been strictly maintained due to known breaking changes.
See all releases.
To release a new version of this gem, run script/release
from the master
branch.
This will create and tag the release.
It will also create prs in the relevant repos and assign them to you. It is your responsibility to
The relevant repos are:
Author: Github
Source Code: https://github.com/github/pages-gem
License: MIT license
1660105380
Ruby-FFI is a gem for programmatically loading dynamically-linked native libraries, binding functions within them, and calling those functions from Ruby code. Moreover, a Ruby-FFI extension works without changes on CRuby (MRI), JRuby, Rubinius and TruffleRuby. Discover why you should write your next extension using Ruby-FFI.
(https://github.com/ffi/ffi/wiki)
require 'ffi'
module MyLib
extend FFI::Library
ffi_lib 'c'
attach_function :puts, [ :string ], :int
end
MyLib.puts 'Hello, World using libc!'
For less minimalistic and more examples you may look at:
samples/
folderWhen installing the gem on CRuby (MRI), you will need:
gcc
or clang
on everything else) Optionally (speeds up installation):libffi
library and development headers - this is commonly in the libffi-dev
or libffi-devel
packagesThe ffi gem comes with a builtin libffi version, which is used, when the system libffi library is not available or too old. Use of the system libffi can be enforced by:
gem install ffi -- --enable-system-libffi # to install the gem manually
bundle config build.ffi --enable-system-libffi # for bundle install
or prevented by --disable-system-libffi
.
On Linux systems running with PaX (Gentoo, Alpine, etc.), FFI may trigger mprotect
errors. You may need to disable mprotect for ruby (paxctl -m [/path/to/ruby]
) for the time being until a solution is found.
On FreeBSD systems pkgconf must be installed for the gem to be able to compile using clang. Install either via packages pkg install pkgconf
or from ports via devel/pkgconf
.
On JRuby and TruffleRuby, there are no requirements to install the FFI gem, and require 'ffi'
works even without installing the gem (i.e., the gem is preinstalled on these implementations).
From rubygems:
[sudo] gem install ffi
From a Gemfile using git or GitHub
gem 'ffi', github: 'ffi/ffi', submodules: true
or from the git repository on github:
git clone git://github.com/ffi/ffi.git
cd ffi
git submodule update --init --recursive
bundle install
rake install
--enable-system-libffi
: Force usage of system libffi--disable-system-libffi
: Force usage of builtin libffi--enable-libffi-alloc
: Force closure allocation by libffi--disable-libffi-alloc
: Force closure allocation by builtin methodAuthor: ffi
Source Code: https://github.com/ffi/ffi
License: BSD-3-Clause and 2 other licenses found
1659351660
Please create a ticket on github if you have issues. They will be addressed ASAP.
Please look at the homepage for more details. Or take a look at the github page
This is a Rails e-commerce platform. ROR Ecommerce is a Rails 5.1 application with the intent to allow developers to create an ecommerce solution easily. This solution includes an Admin for Purchase Orders, Product creation, Shipments, Fulfillment and creating Orders. There is a minimal customer facing shopping cart understanding that this will be customized. The cart allows you to track your customers' cart history and includes a double entry accounting system.
The project has Solr searching, Compass and Zurb Foundation for CSS and uses jQuery. Currently the most complete Rails solution for your small business.
Please use Ruby 2.4 and enjoy Rails 5.1.
ROR Ecommerce is designed so that if you understand Rails you will understand ROR_ecommerce. There is nothing in this project besides what you might see in a normal Rails application. If you don't like something, you are free to just change it like you would in any other Rails app.
Contributors are welcome! We will always need help with UI, documentation, and code, so feel free to pitch in. To get started, simply fork this repo, make any changes (big or small), and create a pull request.
Take a look at The Demo. The login name is test@ror-e.com with a password => test123
NOTE: Given that everyone has admin rights to the demo it is frequently looking less than "beautiful".
Please feel free to ask/answer questions in our Google Group.
Install RVM with Ruby 2.4. If you have 2.4 on your system you're good to go. Please refer to the RVM site for more details.
Copy the database.yml
for your setup. For SQLite3, cp config/database.yml.sqlite3 config/database.yml
. For MySQL, cp config/database.yml.mysql config/database.yml
and update your username/password.
If you are using the mysql dmg file to install mysql you will need to edit your ~/.bash_profile and include this:
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH
Install gems and build the app
gem install bundler
bundle install
rake secret # copy/paste the output as `encryption_key` in `config/settings.yml`
rake db:create:all
rake db:migrate db:seed
RAILS_ENV=test rake db:test:prepare
RAILS_ENV=test rake db:seed
Once everything is set up, start the server with rails server
and direct your web browser to localhost:3000/admin/overviews. Write down the username/password (these are only shown once) and follow the directions.
Most users are using Amazon S3 or Heroku. Thus we have decided to have a setup easy to get your site up and running as quickly as possible in this production environment. Hence you should add the following ENV variables:
FOG_DIRECTORY => your bucket on AWS
AWS_ACCESS_KEY_ID => your access key on AWS
AWS_SECRET_ACCESS_KEY => your secret key on AWS
AUTHNET_LOGIN => if you use authorize.net otherwise change config/settings.yml && config/environments/*.rb
AUTHNET_PASSWORD => if you use authorize.net otherwise change config/settings.yml && config/environments/*.rb
On linux:
export FOG_DIRECTORY=xxxxxxxxxxxxxxx
export AWS_ACCESS_KEY_ID=xxxxxxxxxxxxxxx
export AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
export AUTHNET_LOGIN=xxxxxxxxxxx
export AUTHNET_PASSWORD=xxxxxxxxxxxxxxx
On Heroku:
heroku config:add FOG_DIRECTORY=xxxxxxxxxxxxxxx
heroku config:add AWS_ACCESS_KEY_ID=xxxxxxxxxxxxxxx
heroku config:add AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
heroku config:add AUTHNET_LOGIN=xxxxxxxxxxx
heroku config:add AUTHNET_PASSWORD=xxxxxxxxxxxxxxx
heroku labs:enable user-env-compile -a myapp
This is needed for using sendgrid on heroku(config/initializers/mail.rb):
heroku config:add SENDGRID_USERNAME=xxxxxxxxxxx
heroku config:add SENDGRID_PASSWORD=xxxxxxxxxxxxxxx
If you just want to see what ror_ecommerce looks like, before you enter any products into the database, run the following command:
rake db:seed_fake
If you have not already done so point your browser to http://lvh.me:3000/admin/overviews and set up the admin user.
You should now have a minimal dataset, and be able to see a demo of the various parts of the app. Note: make sure you have config/settings.yml
set up correctly before you try to checkout. Also, please take a look at The 15 minute e-commerce video.
If installing rMagick on OS X 10.8 and using Homebrew to install ImageMagick, you will need to symlink across some files or rMagick will not be able to build.
Do the following in the case of a Homebrew installed ImageMagick(and homebrew had issues):
* cd /usr/local/Cellar/imagemagick/6.8.9-8/lib
* ln -s libMagick++-6.Q16.5.dylib libMagick++.dylib
* ln -s libMagickCore-6.Q16.2.dylib libMagickCore.dylib
* ln -s libMagickWand-6.Q16.2.dylib libMagickWand.dylib
* you may need to change the version path if the imagemagick has been updated
If you would like to read the docs, you can generate them with the following command:
yardoc --no-private --protected app/models/*.rb
First, create config/settings.yml
and change the encryption key and paypal/auth.net information. You can also change config/settings.yml.example
to config/settings.yml
until you get your real info.
To change from authlogic to any other gateway look at the documentation HERE
Paperclip will throw errors if not configured correctly. You will need to find out where Imagemagick is installed. Type: which identify
in the terminal and set
Paperclip.options[:command_path]
equal to that path in config/initializers/paperclip.rb
.
Example:
Change:
Paperclip.options[:command_path] = "/usr/local/bin"
Into:
Paperclip.options[:command_path] = "/usr/bin"
While optional, for a speedy site, using memcached is a good idea.
Install memcached. If you're on a Mac, the easiest way to install Memcached is to use homebrew:
brew install memcached
memcached -vv
Remove the cookie store on line one of config/initializers/session_store.rb
. In your Gemfile add:
gem 'dalli'
then:
bundle install
Finally uncomment the next two lines in config/initializers/session_store.rb
require 'action_dispatch/middleware/session/dalli_store'
Hadean::Application.config.session_store :dalli_store, :key => '_hadean_session_ugrdr6765745ce4vy'
It is also recommended to change the cache store in config/environments/*.rb
config.cache_store = :dalli_store
brew install solr
Uncomment the following in your gemfile:
#gem 'sunspot_solr'
#gem 'sunspot_rails'
then:
bundle install
Start Solr before starting your server:
rake sunspot:solr:start
Go to product.rb
and uncomment:
#include ProductSolr
Also remove the method:
def self.standard_search
Take a look at setting up Solr - Solr in 5 minutes
If you get the error, Errno::ECONNREFUSED (Connection refused - connect(2)):
when you try to create a product or upload an image, you have not started Solr search. You need to run rake sunspot:solr:start
, or remove Solr completely.
Remember to run rake sunspot:reindex
before doing your search if you already have data in the DB
Putting assets on S3 can cause issues with FireFox/IE. You can read about the issue if you search for "S3 & CORS". Basically FF & IE are keeping things more secure but in the process you are required to do some setup.
I ran into the same thing with assets not being public for IE and FireFox but Chrome seemed to work fine. There is a work around for this though. There is something called a CORS Config that opens up your assets to whatever domains you specify.
Here's how to open up your assets to your website. (Thanks @DTwigs)
Now paste this code in there:
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>Content-*</AllowedHeader>
<AllowedHeader>Host</AllowedHeader>
</CORSRule>
</CORSConfiguration>
Typically a product has many variants. (Variant ~= specific size of a given shoe)
If you have many variants with the same image don't bother with an image group, just use the "products.images".
Use ImageGroups for something like shoes. Lets say you have 3 colors, and each color has 10 sizes. You would create 3 images groups (one for each color). The image for each size would be the same and hence each variant would be associated to the same image_group for a given color.
RoR Ecommerce was created by David Henner. Contributors.
Shipping categories are categories based off price:
you might have two shipping categories (light items) & (heavy items) where heavy items are charged per item purchased and light items are charged once for all items purchased. (hence buying 30 feathers has the same shipping charges as one feather)
Have fun!!!
Author: drhenner
Source code: https://github.com/drhenner/ror_ecommerce
License: MIT license
1624651200
Hey guys in this video I talk about Curate ticker XCUR. A viewer to the channel told me about Curate so I thought I would take a deeper dive into the project to see if it was worth investing in. Here are my findings.
📺 The video in this post was made by Crypto expat
The origin of the article: https://www.youtube.com/watch?v=0LUyus-iFMw
🔺 DISCLAIMER: The article is for information sharing. The content of this video is solely the opinions of the speaker who is not a licensed financial advisor or registered investment advisor. Not investment advice or legal advice.
Cryptocurrency trading is VERY risky. Make sure you understand these risks and that you are responsible for what you do with your money
🔥 If you’re a beginner. I believe the article below will be useful to you ☞ What You Should Know Before Investing in Cryptocurrency - For Beginner
⭐ ⭐ ⭐The project is of interest to the community. Join to Get free ‘GEEK coin’ (GEEKCASH coin)!
☞ **-----CLICK HERE-----**⭐ ⭐ ⭐
Thanks for visiting and watching! Please don’t forget to leave a like, comment and share!
#bitcoin #blockchain #shitcoin #stupidly low cap gem #gem #stupidly low cap gem or a shitcoin
1624397400
BITCOIN’S EXPLOSIVE NEXT MOVE & 1000X ETHEREUM ALTCOIN GEM THAT COULD MAKE YOU RICH!
0:00 Bitcoin EXPLODES
1:19 Bitcoin’s next move
Intro to Derivatives
6:14 Crypto Derivatives UNDERVALUED
7:55 Explaining Options
9:13 What is OILER?
11:59 Types of Options on OILER
14:00 Who might use this?
15:59 This is INSANE
17:00 Support the channel!
📺 The video in this post was made by EllioTrades Crypto
️ The origin of the article: https://www.youtube.com/watch?v=e-QfwxsYl54
🔺 DISCLAIMER: The article is for information sharing. The content of this video is solely the opinions of the speaker who is not a licensed financial advisor or registered investment advisor. Not investment advice or legal advice.
Cryptocurrency trading is VERY risky. Make sure you understand these risks and that you are responsible for what you do with your money
🔥 If you’re a beginner. I believe the article below will be useful to you ☞ What You Should Know Before Investing in Cryptocurrency - For Beginner
⭐ ⭐ ⭐The project is of interest to the community. Join to Get free ‘GEEK coin’ (GEEKCASH coin)!
⭐ ⭐ ⭐ Join to Get free ‘GEEK coin’ (GEEKCASH coin)! ☞ https://geekcash.org⭐ ⭐ ⭐
Thanks for visiting and watching! Please don’t forget to leave a like, comment and share!
#bitcoin #ethereum altcoin gem #altcoin #ethereum #gem #blockchain
1624226400
This gem is ready to explode in 2021. Elrond is a enterprise infrastructure blockchain project that has speeds up to 100,000 TPS and 6 second latency time. With a extensive partnerships, large network of nodes and tokenomics to favour wood be investors I think we will be a massive price increase in 2021 for Elrond.
📺 The video in this post was made by Crypto expat
The origin of the article: https://www.youtube.com/watch?v=TFvxcAtb274
🔺 DISCLAIMER: The article is for information sharing. The content of this video is solely the opinions of the speaker who is not a licensed financial advisor or registered investment advisor. Not investment advice or legal advice.
Cryptocurrency trading is VERY risky. Make sure you understand these risks and that you are responsible for what you do with your money
🔥 If you’re a beginner. I believe the article below will be useful to you ☞ What You Should Know Before Investing in Cryptocurrency - For Beginner
⭐ ⭐ ⭐The project is of interest to the community. Join to Get free ‘GEEK coin’ (GEEKCASH coin)!
☞ **-----CLICK HERE-----**⭐ ⭐ ⭐
Thanks for visiting and watching! Please don’t forget to leave a like, comment and share!
#bitcoin #blockchain #gem #crypto #crypto gem #warning : undervalued crypto gem ready to explode in 2021 🚀🚀
1623805200
Hey guys in the video I talk about a project I think is a under valued gem. The project is ambitious and extensive roadmap. The tokenomics is great, there’s 500MM+ volume going through it’s swap, and its anticipated LaunchPadX which will be IDO projects launching on their platform. Obv DYOR research let me know what you think.
📺 The video in this post was made by Crypto expat
The origin of the article: https://www.youtube.com/watch?v=brvAGiO4vx4
🔺 DISCLAIMER: The article is for information sharing. The content of this video is solely the opinions of the speaker who is not a licensed financial advisor or registered investment advisor. Not investment advice or legal advice.
Cryptocurrency trading is VERY risky. Make sure you understand these risks and that you are responsible for what you do with your money
🔥 If you’re a beginner. I believe the article below will be useful to you ☞ What You Should Know Before Investing in Cryptocurrency - For Beginner
⭐ ⭐ ⭐The project is of interest to the community. Join to Get free ‘GEEK coin’ (GEEKCASH coin)!
☞ **-----CLICK HERE-----**⭐ ⭐ ⭐
(There is no limit to the amount of credit you can earn through referrals)
Thanks for visiting and watching! Please don’t forget to leave a like, comment and share!
#bitcoin #blockchain #gem #litecoin giveaway #seriously under-valued gem #seriously under-valued gem, how did this gem slip through my fingers?, litecoin giveaway
1623789660
Could Upcoming POLYGON Gem POLYWHIRL Do A 100x? 100x Altcoin
📺 The video in this post was made by EverythingAltcoin
️ The origin of the article: https://www.youtube.com/watch?v=xuKosiGi7fE
🔺 DISCLAIMER: The article is for information sharing. The content of this video is solely the opinions of the speaker who is not a licensed financial advisor or registered investment advisor. Not investment advice or legal advice.
Cryptocurrency trading is VERY risky. Make sure you understand these risks and that you are responsible for what you do with your money
🔥 If you’re a beginner. I believe the article below will be useful to you ☞ What You Should Know Before Investing in Cryptocurrency - For Beginner
⭐ ⭐ ⭐The project is of interest to the community. Join to Get free ‘GEEK coin’ (GEEKCASH coin)!
⭐ ⭐ ⭐ Join to Get free ‘GEEK coin’ (GEEKCASH coin)! ☞ https://geekcash.org⭐ ⭐ ⭐
(There is no limit to the amount of credit you can earn through referrals)
Thanks for visiting and watching! Please don’t forget to leave a like, comment and share!
#bitcoin #blockchain #polygon #gem #poliwhirl
1623612600
THESE 2 DEFI ALTCOIN GEMS HAVE INSANE POTENTIAL
0:00 It’s TIME for Alts
1:00 Scammer Warning!
1:40 Altcoin #1
5:05 Altcoin #2
9:09 DeFi will return!
11:00 Support the Channel
📺 The video in this post was made by EllioTrades Crypto
️ The origin of the article: https://www.youtube.com/watch?v=hv5LsRbjaSg
🔺 DISCLAIMER: The article is for information sharing. The content of this video is solely the opinions of the speaker who is not a licensed financial advisor or registered investment advisor. Not investment advice or legal advice.
Cryptocurrency trading is VERY risky. Make sure you understand these risks and that you are responsible for what you do with your money
🔥 If you’re a beginner. I believe the article below will be useful to you ☞ What You Should Know Before Investing in Cryptocurrency - For Beginner
⭐ ⭐ ⭐The project is of interest to the community. Join to Get free ‘GEEK coin’ (GEEKCASH coin)!
⭐ ⭐ ⭐ Join to Get free ‘GEEK coin’ (GEEKCASH coin)! ☞ https://geekcash.org⭐ ⭐ ⭐
(There is no limit to the amount of credit you can earn through referrals)
Thanks for visiting and watching! Please don’t forget to leave a like, comment and share!
#bitcoin #blockchain #gem #altcoin defi
1623260280
Labs ($LABS): the underexplored gem
📺 The video in this post was made by Boxmining Clips
️ The origin of the article: https://www.youtube.com/watch?v=H9XQH9JfOyY
🔺 DISCLAIMER: The article is for information sharing. The content of this video is solely the opinions of the speaker who is not a licensed financial advisor or registered investment advisor. Not investment advice or legal advice.
Cryptocurrency trading is VERY risky. Make sure you understand these risks and that you are responsible for what you do with your money
🔥 If you’re a beginner. I believe the article below will be useful to you ☞ What You Should Know Before Investing in Cryptocurrency - For Beginner
⭐ ⭐ ⭐The project is of interest to the community. Join to Get free ‘GEEK coin’ (GEEKCASH coin)!
⭐ ⭐ ⭐ Join to Get free ‘GEEK coin’ (GEEKCASH coin)! ☞ https://geekcash.org⭐ ⭐ ⭐
(There is no limit to the amount of credit you can earn through referrals)
Thanks for visiting and watching! Please don’t forget to leave a like, comment and share!
#bitcoin #blockchain #labs ($labs) #gem
1623105000
0:00 My next GEM!
1:15 Decentr Overview
4:16 Price Analysis
4:54 Feature Comps
5:23 Tons of Upside
5:45 Pepe Coverage
6:32 Tokenomics
7:04 Other good stuff
7:35 More Price Analysis
7:58 Why I’m BULLISH
9:30 Support the channel
📺 The video in this post was made by EllioTrades Crypto
️ The origin of the article: https://www.youtube.com/watch?v=QbIRJcBr9zA
🔺 DISCLAIMER: The article is for information sharing. The content of this video is solely the opinions of the speaker who is not a licensed financial advisor or registered investment advisor. Not investment advice or legal advice.
Cryptocurrency trading is VERY risky. Make sure you understand these risks and that you are responsible for what you do with your money
🔥 If you’re a beginner. I believe the article below will be useful to you ☞ What You Should Know Before Investing in Cryptocurrency - For Beginner
⭐ ⭐ ⭐The project is of interest to the community. Join to Get free ‘GEEK coin’ (GEEKCASH coin)!
⭐ ⭐ ⭐ Join to Get free ‘GEEK coin’ (GEEKCASH coin)! ☞ https://geekcash.org⭐ ⭐ ⭐
(There is no limit to the amount of credit you can earn through referrals)
Thanks for visiting and watching! Please don’t forget to leave a like, comment and share!
#bitcoin #blockchain #gains #gem #massive gains #insane low cap
1597556331
This is going to be a very straightforward article, no jokes included.
When you want to populate you database during development, you need to use a file that already comes in Rails: the seeds.rb file. You can find it inside the db folder, the same where you can find the migration and schema files.
Aside from that you’ll need two gems: the Populator gem, and the Faker gem. The last one is not actually necessary, but makes your life a lot easier, and your dummy data much more realistic.
The Populator gem will allow you to do something close to what Factory_bot does in test environment: you’ll set the data that will be provided, and the gem will automatically create several instances of your model to populate. If you only use Populator, you’ll have to hardcode the content provided - not cool.
That’s where Faker comes in. It has a huge array of fake content that is available to you. It can generate names, emails, credit card numbers, addresses, you name it. It randomly returns one every time it is called.
So, to the steps.
Go to your Gemfile, and make it like this:
group :development, :test do
gem 'faker'
gem 'populator'
end
Run in your terminal:
bundle install
Go to your _lib _folder. You’ll have to do some patching in Populator gem if you use Rails version after 5.1. Inside the lib folder, create a file called populator_fix.rb. Copy the following code and paste inside it:
module Populator
## Builds multiple Populator::Record instances and saves them to the database
class Factory
def rows_sql_arr
@records.map do |record|
quoted_attributes = record.attribute_values.map { |v| @model_class.connection.quote(v) }
"(#{quoted_attributes.join(', ')})"
end
end
end
end
Save it.
Go to your seeds.rb file, and require this patch. On the first line, add the following:
require_relative '../lib/populator_fix.rb'
That’s it. Your gems are set, let’s do some code!
#ruby-on-rails #rails #ruby #gem #database #development #automation #full-stack-development