eksa-framework 2.3.2 โ†’ 3.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f15480cfb455196634bec205c45a10a83abf031d398915f38652a793f9b98c84
4
- data.tar.gz: 33577ecbf0baf8f1bfb66abfbbf30c39e7cfac37500aefb64d2cabe4d50b2e83
3
+ metadata.gz: 780c728ee88c41e54a84523f1d70bec838d559c165322ef92afadd4623f2e1b4
4
+ data.tar.gz: 3096a17f07c232b8b8c80a706e51310f3fc6196077877390c46b7e1fe4f802cb
5
5
  SHA512:
6
- metadata.gz: 61cc9369d8553779a045858906a451e4370a7121370205a2b2ff1311412f16103b76896b9a206cd629150abe1313ee822a582b8e225d13d6c0bcf2be29ffd942
7
- data.tar.gz: d05d48c0ee928aa8c70942224a003632ac29404e5a588e377724570a51ca1afdb6c3bb83dd5489f0e06287f577c1d39c1cc53ada3f6d5303faa741552dc24a42
6
+ metadata.gz: 96c60d22e3632b4a08402c1e4a3b4ad5cbd82c3e209b87d30725cb7de9fb6dd4cd43b61eea09c62378cced2696286efaf199c70824521c3968ef775688feeed8
7
+ data.tar.gz: d2ecc1406064d10b52d08763b0e72dc6b65c3fa2b8c97dc16141ec57c0b6e526ed537da964b827c7bf460e28c430727963338c14993038d04e98e4b059cc2bda
data/README.md CHANGED
@@ -18,6 +18,7 @@
18
18
  * ๐Ÿงช **Built-in Testing**: Lingkungan pengujian otomatis siap pakai menggunakan RSpec dan `rack-test`.
19
19
  * ๐ŸŽจ **Asset Helpers**: Library bawaan untuk pengelolaan CSS dan JS yang lebih rapi.
20
20
  * ๐Ÿ” **Dynamic SEO Engine**: Penanganan otomatis file `robots.txt` dan `sitemap.xml`.
21
+ * ๐Ÿ’Ž **JSON-LD Support**: Dukungan data terstruktur (Structured Data) otomatis untuk SEO yang lebih optimal.
21
22
  * ๐Ÿ‘ป **Aesthetic Error Pages**: Halaman 404 dengan desain Glassmorphism yang elegan secara native.
22
23
 
23
24
  ---
@@ -123,4 +124,4 @@ bundle exec rspec
123
124
  ---
124
125
 
125
126
  ## ๐Ÿ“œ Lisensi
126
- Proyek ini dilisensikan di bawah **MIT License**. Lihat file [LICENSE](LICENSE) untuk detail lebih lanjut.
127
+ Proyek ini dilisensikan di bawah **MIT License**. Lihat file [LICENSE](https://github.com/IshikawaUta/eksa-framework/blob/main/LICENSE) untuk detail lebih lanjut.
@@ -1,27 +1,40 @@
1
1
  class SeoController < Eksa::Controller
2
2
  def robots
3
+ scheme = request.env['rack.url_scheme'] || 'https'
3
4
  content = <<~TEXT
4
5
  User-agent: *
5
6
  Allow: /
6
7
  Disallow: /hapus
7
8
  Disallow: /edit
8
9
 
9
- Sitemap: https://#{request.host}/sitemap.xml
10
+ Sitemap: #{scheme}://#{request.host}/sitemap.xml
10
11
  TEXT
11
12
  [200, { "Content-Type" => "text/plain" }, [content]]
12
13
  end
13
14
 
14
15
  def sitemap
16
+ scheme = request.env['rack.url_scheme'] || 'https'
17
+ base_url = "#{scheme}://#{request.host}"
15
18
  lastmod = Time.now.strftime("%Y-%m-%d")
16
19
 
17
20
  xml = '<?xml version="1.0" encoding="UTF-8"?>'
18
21
  xml += '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'
19
22
 
20
- ["/", "/about", "/docs", "/kontak"].each do |path|
23
+ # Base Pages
24
+ ["/", "/about", "/docs", "/kontak", "/posts"].each do |path|
21
25
  xml += "<url>"
22
- xml += "<loc>https://#{request.host}#{path}</loc>"
26
+ xml += "<loc>#{base_url}#{path}</loc>"
23
27
  xml += "<lastmod>#{lastmod}</lastmod>"
24
- xml += "<priority>0.8</priority>"
28
+ xml += "<priority>#{path == '/' ? '1.0' : '0.8'}</priority>"
29
+ xml += "</url>"
30
+ end
31
+
32
+ # Blog Posts
33
+ Eksa::MarkdownPost.all.each do |post|
34
+ xml += "<url>"
35
+ xml += "<loc>#{base_url}/posts/#{post.slug}</loc>"
36
+ xml += "<lastmod>#{post.date.is_a?(Time) ? post.date.strftime("%Y-%m-%d") : lastmod}</lastmod>"
37
+ xml += "<priority>0.6</priority>"
25
38
  xml += "</url>"
26
39
  end
27
40
 
@@ -155,7 +155,7 @@
155
155
  <p class="text-white/30"># Build gem lokal</p>
156
156
  <p class="text-indigo-300">gem build eksa-framework.gemspec</p>
157
157
  <p class="text-white/30 mt-4"># Publish ke RubyGems / GitHub Packages</p>
158
- <p class="text-indigo-300">gem push eksa-framework-2.3.2.gem</p>
158
+ <p class="text-indigo-300">gem push eksa-framework-3.3.2.gem</p>
159
159
  </div>
160
160
  </section>
161
161
 
@@ -164,7 +164,7 @@
164
164
  <span class="bg-indigo-500/20 text-indigo-300 text-[10px] px-3 py-1 rounded-full border border-indigo-500/30 uppercase tracking-tighter">Rack 3.0 Compatible</span>
165
165
  <span class="bg-emerald-500/20 text-emerald-300 text-[10px] px-3 py-1 rounded-full border border-emerald-500/30 uppercase tracking-tighter">SQLite3 Auto-Ready</span>
166
166
  </div>
167
- <p class="text-white/40 text-sm italic">Eksa Framework v2.3.2 Alpha Documentation</p>
167
+ <p class="text-white/40 text-sm italic">Eksa Framework v3.3.2 Alpha Documentation</p>
168
168
  <a href="/" class="inline-block mt-6 text-indigo-300 hover:text-white transition font-bold flex items-center justify-center gap-2">
169
169
  <i data-lucide="arrow-left" class="w-4 h-4"></i> Kembali ke Beranda
170
170
  </a>
@@ -2,7 +2,7 @@
2
2
  <div class="flex flex-col md:flex-row justify-between items-start md:items-center mb-8 gap-4">
3
3
  <div>
4
4
  <span class="inline-block bg-indigo-500/20 text-indigo-200 text-xs font-bold px-3 py-1 rounded-full mb-3 border border-indigo-500/30">
5
- v2.3.2 Alpha
5
+ v3.3.2 Alpha
6
6
  </span>
7
7
  <h1 class="text-4xl font-extrabold tracking-tight">
8
8
  Halo, <span class="text-indigo-300"><%= @nama %></span>!
@@ -10,6 +10,38 @@
10
10
  <meta property="og:title" content="Eksa Framework">
11
11
  <meta property="og:description" content="Membangun web cepat dengan estetika transparan.">
12
12
  <meta property="og:type" content="website">
13
+
14
+ <%
15
+ scheme = request.env['rack.url_scheme'] || 'https'
16
+ base_url = "#{scheme}://#{request.host}"
17
+ current_url = "#{base_url}#{request.path}"
18
+
19
+ if @post
20
+ structured_data = {
21
+ "@context": "https://schema.org",
22
+ "@type": "BlogPosting",
23
+ "headline": @post.title,
24
+ "datePublished": (@post.date.is_a?(Time) ? @post.date.iso8601 : @post.date),
25
+ "author": {
26
+ "@type": "Person",
27
+ "name": "IshikawaUta"
28
+ },
29
+ "url": current_url,
30
+ "description": @post.body_html[0..160].gsub(/<[^>]*>/, '').strip + "..."
31
+ }
32
+ else
33
+ structured_data = {
34
+ "@context": "https://schema.org",
35
+ "@type": "WebSite",
36
+ "name": "Eksa Framework",
37
+ "url": base_url,
38
+ "description": "Framework Ruby Modern dengan sentuhan Glassmorphism"
39
+ }
40
+ end
41
+ %>
42
+ <script type="application/ld+json">
43
+ <%= structured_data.to_json %>
44
+ </script>
13
45
  <link rel="preconnect" href="https://fonts.googleapis.com">
14
46
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
15
47
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
@@ -1,3 +1,6 @@
1
+ # frozen_string_literal: true
2
+ # encoding: utf-8
3
+
1
4
  require 'yaml'
2
5
  require 'kramdown'
3
6
 
@@ -40,7 +43,7 @@ module Eksa
40
43
  private
41
44
 
42
45
  def load_file(file_path)
43
- content = File.read(file_path)
46
+ content = File.read(file_path, encoding: 'utf-8')
44
47
  # Improved regex: handle optional trailing newline after second separator
45
48
  if content =~ /\A(---\s*\r?\n.*?\r?\n)^(---\s*\r?\n?)/m
46
49
  @metadata = YAML.safe_load($1, permitted_classes: [Time])
data/lib/eksa/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Eksa
2
- VERSION = "2.3.2"
2
+ VERSION = "3.3.2"
3
3
  end
data/lib/eksa.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'rack'
2
+ require 'json'
2
3
  require_relative 'eksa/version'
3
4
  require_relative 'eksa/controller'
4
5
  require_relative 'eksa/model'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eksa-framework
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.2
4
+ version: 3.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - IshikawaUta