diff --git a/Gemfile b/Gemfile index fdf97428..9b7fe692 100644 --- a/Gemfile +++ b/Gemfile @@ -46,6 +46,7 @@ gem 'rinku' gem 'image_optim' gem 'image_optim_pack' gem 'ipaddress' +gem 'feedjira' platform :mri, :rbx do gem 'magic' # sudo apt-get install file, For OSX: brew install libmagic diff --git a/Gemfile.lock b/Gemfile.lock index 0bf1e9b7..d3553f8f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -71,6 +71,13 @@ GEM i18n (~> 0.5) faraday (0.9.2) multipart-post (>= 1.2, < 3) + faraday_middleware (0.9.2) + faraday (>= 0.7.4, < 0.10) + feedjira (2.1.0) + faraday (>= 0.9) + faraday_middleware (>= 0.9) + loofah (>= 2.0) + sax-machine (>= 1.0) ffi (1.9.10) ffi-compiler (0.1.3) ffi (>= 1.0.0) @@ -116,6 +123,8 @@ GEM rack (~> 1.4) rest-client (~> 1.0) json (1.8.3) + loofah (2.0.3) + nokogiri (>= 1.5.9) m (1.4.2) method_source (>= 0.6.7) rake (>= 0.9.2.2) @@ -201,6 +210,7 @@ GEM nokogiri (>= 1.4.4) nokogumbo (~> 1.4.1) sass (3.4.22) + sax-machine (1.3.2) scrypt (2.1.1) ffi-compiler (>= 0.0.2) rake @@ -285,6 +295,7 @@ DEPENDENCIES erubis fabrication faker + feedjira filesize gandi geoip diff --git a/app/index.rb b/app/index.rb index 32bc5857..1b26cccf 100644 --- a/app/index.rb +++ b/app/index.rb @@ -31,11 +31,29 @@ get '/?' do end if SimpleCache.expired?(:sites_count) - @sites_count = SimpleCache.store :sites_count, Site.count.roundup(100), 600 # 10 Minutes + @sites_count = SimpleCache.store :sites_count, Site.count.roundup(100), 10.minutes else @sites_count = SimpleCache.get :sites_count end + if SimpleCache.expired?(:blog_feed_html) + @blog_feed_html = '' + + begin + xml = HTTP.timeout(read: 2, write: 2, connect: 2).get('https://blog.neocities.org/feed.xml').to_s + feed = Feedjira::Feed.parse xml + feed.entries[0..2].each do |entry| + @blog_feed_html += %{#{entry.title.split('.').first} #{entry.published.strftime('%b %-d, %Y')}
} + end + rescue + @blog_feed_html = 'The latest news on Neocities can be found on our blog.' + end + + @blog_feed_html = SimpleCache.store :blog_feed_html, @blog_feed_html, 8.hours + else + @blog_feed_html = SimpleCache.get :blog_feed_html + end + erb :index, layout: :index_layout end diff --git a/public/img/discourse-logo.png b/public/img/discourse-logo.png deleted file mode 100644 index 13a22eef..00000000 Binary files a/public/img/discourse-logo.png and /dev/null differ diff --git a/views/_footer.erb b/views/_footer.erb index 180638f5..1a3009f7 100644 --- a/views/_footer.erb +++ b/views/_footer.erb @@ -17,7 +17,6 @@ <% end %>
  • Status
  • Terms
  • -
  • Privacy
  • Contact
  • diff --git a/views/about.erb b/views/about.erb index b7744d48..86e85d7c 100644 --- a/views/about.erb +++ b/views/about.erb @@ -10,19 +10,17 @@

    Neocities is bringing back the fun, creativity and independence that made the web great.

    - We are tired of living in an online world where people are isolated from each other on boring web sites with generic templates defining what people are - supposed to know or communicate with each other. It's time we took back our personalities from these sterilized, lifeless, - monetized, data mined, monitored entities and let our creativity flourish again. + We are tired of living in an online world where people are isolated from each other on boring, generic social networks that don't let us truly express ourselves. It's time we took back our personalities from these sterilized, lifeless, + monetized, data mined, monitored addiction machines and let our creativity flourish again.

    That's where Neocities comes in. We provide a canvas for people to make any web site they want. Whether it be a web site about something they're good at, something they love, something they hate, or their own completely customized profile where they can introduce themselves in a way that actually matters to them. - We can do this without selling out to the marketing industry, and we're going to prove it.

    - It's a tough project. We've got big problems to solve (restrained from easier solutions by our principles), and big ambitions. We have a lot of work to do. But our goal is clear: to enable you to harness the creativity, beauty, and power of creating your own web site. To rebuild the web we lost to monotony, and make it fun again. + Our goal: to enable you to harness the creativity, beauty, and power of creating your own web site. To rebuild the web we lost to automation and monotony, and make it fun again.

    Neocities is just getting started, and we've got a lot of amazing things in store. I strongly believe that, with your help, we're really going to shake things up on the web. Thank you for believing in us (and yourselves). @@ -40,14 +38,14 @@

    - If you share our values, we would love your support. Spread the word! We also have a supporter plan to help pay for the site, and we accept donations through multiple options (including Bitcoin... and Dogecoin). + If you share our values, we would love your support. Spread the word! We also have a supporter plan to help pay for the site, and we accept donations through multiple options (including Bitcoin).

    <%== erb :'_team', layout: false %> diff --git a/views/index.erb b/views/index.erb index 8e68058b..3515316d 100644 --- a/views/index.erb +++ b/views/index.erb @@ -59,21 +59,21 @@

    Create your own free website.
    Unlimited creativity, zero ads.

    - Neocities is a community of <%= @sites_count.to_s.reverse.gsub(/...(?=.)/,'\&,').reverse %> sites that are bringing back the lost individual creativity of the web. We offer free web hosting and tools that allow anyone to make a website. Join us! + Neocities is a social network of <%= @sites_count.to_s.reverse.gsub(/...(?=.)/,'\&,').reverse %> web sites that are bringing back the lost individual creativity of the web. We offer free web hosting and tools that allow you to create your own web site. Join us!

    @@ -198,7 +198,7 @@
    -

    It's time to bring back web surfing.

    +

    Welcome back, web surfing

    All Neocities sites are viewable in our website gallery. And it's easy to browse sites with our optional surf bar.

    Using tags (our version of Web Rings) you can easily discover new sites related to your interests.

    @@ -232,22 +232,21 @@

    -

    More space, speed, and security

    -

    Neocities now uses distributed, globally-cached web servers in datacenters all over the world to serve your site. Whether it’s your personal home page or a busy professional site, your site loads fast. And if you need more space, we've got you covered. We also provide Snowden-grade SSL cryptography on all sites, preventing snoops from seeing what you browse.

    +

    Neocities now uses distributed, globally-cached web servers in datacenters all over the world to serve your site. Whether it’s your personal home page or a busy professional site, your site loads fast. We also force 100% strong SSL on all sites, preventing snoops from seeing what you browse.

    Developer tools

    -

    Our fast static hosting comes with a great in-browser HTML editor, easy file uploading, RSS feeds for every site, powerful APIs for building developer applications, and much more! Upgrade to a supporter plan to get support for custom domains and WebDAV publishing.

    +

    Our fast static hosting comes with a great in-browser HTML editor, easy file uploading, RSS feeds for every site, APIs for building developer applications, and much more!

    -

    Open Company

    -

    Neocities is a member of the Open Company Initative, working to help improve trustability in tech companies. We publish the code that powers the site for inspection, and strive for openness in our company's operations. We want to win your trust—not lock you in.

    +

    Open Source

    +

    We publish the code that powers the site for inspection. We want to win your trust—not lock you in.

    @@ -277,15 +276,16 @@

    What are you waiting for? Start building your website now!

    +