post command, cammie
This commit is contained in:
parent
31bd17f760
commit
55c9184d35
7 changed files with 120 additions and 20 deletions
1
Gemfile
1
Gemfile
|
@ -22,4 +22,5 @@ gem 'autoprefixer-rails'
|
|||
group :development do
|
||||
gem 'adsf'
|
||||
gem 'guard-nanoc'
|
||||
gem 'highline'
|
||||
end
|
||||
|
|
|
@ -34,6 +34,7 @@ GEM
|
|||
nanoc (~> 4.0)
|
||||
hamster (3.0.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
highline (1.7.8)
|
||||
icalendar (2.4.0)
|
||||
json (2.0.2)
|
||||
kramdown (1.11.1)
|
||||
|
@ -83,6 +84,7 @@ DEPENDENCIES
|
|||
builder
|
||||
coffee-script
|
||||
guard-nanoc
|
||||
highline
|
||||
icalendar
|
||||
kramdown
|
||||
nanoc (= 4.2.4)
|
||||
|
|
3
Rules
3
Rules
|
@ -129,9 +129,6 @@ passthrough '/assets/images/*.{png}'
|
|||
#
|
||||
#
|
||||
|
||||
#
|
||||
# HOMEPAGE
|
||||
#
|
||||
#
|
||||
# ASSETS
|
||||
#
|
||||
|
|
49
commands/post.rb
Normal file
49
commands/post.rb
Normal file
|
@ -0,0 +1,49 @@
|
|||
require 'highline/import'
|
||||
require 'yaml'
|
||||
|
||||
usage 'post [options]'
|
||||
aliases :p
|
||||
summary 'Add a new post'
|
||||
description 'Adds a new post, filling in and validating metadata.'
|
||||
|
||||
def bold_say(str)
|
||||
say "<%= color %(#{str}), :bold %>"
|
||||
end
|
||||
|
||||
def bold_ask(str, *args)
|
||||
ask "<%= color %(#{str}), :bold %>", *args
|
||||
end
|
||||
|
||||
run do |_opts, _args, _cmd|
|
||||
result_hash = {}
|
||||
|
||||
bold_say "Let's make a new post, shall we?"
|
||||
bold_say('-' * 20)
|
||||
|
||||
puts
|
||||
|
||||
bold_say 'What kind of post will it be?'
|
||||
|
||||
type = choose do |menu|
|
||||
default = :event
|
||||
|
||||
menu.prompt = "(default #{default})"
|
||||
menu.choice :blog
|
||||
menu.choice :event
|
||||
menu.default = default
|
||||
end
|
||||
|
||||
puts
|
||||
|
||||
result_hash['title'] = bold_ask 'What will the title be?'
|
||||
|
||||
puts
|
||||
|
||||
result_hash['time'] = bold_ask 'When will the event take place?', Date
|
||||
|
||||
puts
|
||||
|
||||
result_hash['banner'] = bold_ask 'Supply a link to the banner of the event, please' if type == :event
|
||||
|
||||
puts result_hash.to_yaml
|
||||
end
|
|
@ -1,7 +1,10 @@
|
|||
#cammie {
|
||||
object-fit: contain;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
#cammie-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
position: relative;
|
||||
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.fullpage {
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
html, body {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
.fa-ul {
|
||||
list-style: none !important;
|
||||
|
||||
|
|
|
@ -3,7 +3,35 @@ navigable: true
|
|||
title: Cammie
|
||||
---
|
||||
|
||||
<section class="hero is-fullheight">
|
||||
<!-- Hero header: will stick at the top -->
|
||||
<div class="hero-head">
|
||||
<%= render '/partials/_navbar.*' %>
|
||||
</div>
|
||||
|
||||
<!-- Hero content: will be in the middle -->
|
||||
<div class="hero-body">
|
||||
<!--
|
||||
<div id="cammie-container">
|
||||
<img id="cammie" src="https://kelder.zeus.ugent.be/webcam/video/mjpg.cgi?profileid=2" alt="" />
|
||||
</div>
|
||||
-->
|
||||
|
||||
<div class="columns">
|
||||
<div class="column">top</div>
|
||||
<div class="column">top</div>
|
||||
<div class="column">top</div>
|
||||
</div>
|
||||
<div class="columns">
|
||||
<div class="column">mid</div>
|
||||
<div class="column">mid</div>
|
||||
<div class="column">mid</div>
|
||||
</div>
|
||||
<div class="columns">
|
||||
<div class="column">bot</div>
|
||||
<div class="column">bot</div>
|
||||
<div class="column">bot</div>
|
||||
</div>
|
||||
|
||||
<div id="left" class="ctrl">
|
||||
<%= fa 'chevron-left', size: '2x' %>
|
||||
|
@ -20,5 +48,21 @@ title: Cammie
|
|||
<div id="down" class="ctrl">
|
||||
<%= fa 'chevron-down', size: '2x' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Hero footer: will stick at the bottom -->
|
||||
<div class="hero-foot">
|
||||
<nav class="tabs is-boxed is-fullwidth">
|
||||
<div class="container">
|
||||
<ul>
|
||||
<li><a>Kleine Tafel</a></li>
|
||||
<li><a>Grote Tafel</a></li>
|
||||
<li><a>Zetel</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
<%= asset :js, :cammie %>
|
||||
|
|
Loading…
Reference in a new issue