
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
Estatic (E-commerce Static) is a static e-commerce site generator. This gem dynamically adds products from csv files to your (erb, slim, haml) templates and generates static html pages. The current templates supported are for the home_page
, product_listings_page
, and product_page
.
$ gem install estatic
Go to your working directory
$ cd /path/to/working/directory
The working directory must have a blueprints
folder which may contain the following:
csv
folder for category/subcategory productsshared
folder for template partialscss
folderscripts
folderconfig.yml
home_page.(erb,slim,haml)
product_listings_page.(erb,slim,haml)
for your category/subcategory product listingsproduct_page.(erb,slim,haml)
for individual product pageadditional
folder/s. this will be copied to your static sitefiles and folders are all optional depending on the requirements of your estatic site
A sample working directory structure
+-- working_directory
+-- blueprints
+-- csv
| +-- featured.csv
| +-- category_sample.csv
| +-- subcat_1.csv
| +-- subcat_2.csv
+-- shared
| +-- partial.erb
+-- css
| +-- app.css
+-- scripts
| +-- app.js
+-- optional-folder-of-other-stuff-goes-here
| +-- other-stuff.png
+-- optional-folder-of-another-stuff-goes-here
| +-- another-stuff.ttf
+-- config.yml
+-- home_page.erb
+-- product_listings_page.erb
+-- product_page.erb
In your config.yml
featured: featured # translate featured.csv as home_page products
categories:
- category_sample # translate category_sample.csv as category products
- category_with_subcategory: # translate subcat_1.csv and subcat_2.csv as category products
- subcat_1 # translate subcat_1.csv as subcategory products
- subcat_2 # translate subcat_2.csv as subcategory products
chunk: 20 # maximum number of products per product_listings_page
include_product_page: true # flag to generate product_page, default is false
category and subcategory products are rendered in product_listings_page
There are instance variables you can use depending on which template:
home_page.erb, product_listings_page.erb
@resource
- category/subcategory
.name
.products
- array of products (all).subcategories
- array of subcategory resource objects. only applicable if @resource
is a category@products
- array of products per chunk (current chunk per page). for product_listings_page only.
@products
array has an .attribute_name
depending on the csv header@current_page
@total_pages
product_page.erb
@resource
- category/subcategory
@product
.attribute_name
- depends on the csv headerInside your working directory
$ estatic
It will then generate an estatic_site
folder
$ cd estatic_site
You can now open your generated static pages on your browser
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests or you can run guard bundle exec guard
. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
.
Fork the repo.
Bug reports and pull requests are welcome on GitHub at https://github.com/karloescota/estatic.
The gem is available as open source under the terms of the MIT License.
(c) Karlo Escota
FAQs
Unknown package
We found that estatic demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.