Changeset 75 in code for trunk


Ignore:
Timestamp:
Dec 4, 2023, 12:54:29 AM (18 months ago)
Author:
Izuru Yakumo
Message:

The Empress (III)

  • Change the way how versions are handled in version.go (to ease `go install`)
  • Upgrade yaml.v2 to yaml.v3

Signed-off-by: Izuru Yakumo <yakumo.izuru@…>

Location:
trunk
Files:
17 added
18 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile

    r68 r75  
    1 CGO = 0
    21DESTDIR ?=
    3 GOFLAGS ?= -v -ldflags "-w -X `go list`.Version=$(VERSION) -X `go list`.Commit=$(COMMIT)" -mod=vendor -buildmode=exe
     2GOFLAGS ?= -v -buildvcs=false -mod=vendor -buildmode=exe
    43PREFIX ?= /usr/local
    5 VERSION ?= `git describe --abbrev=0 --tags || echo "$VERSION"`
    6 COMMIT ?= `git rev-parse --short HEAD || echo "$COMMIT"`
    7 
     4VERSION ?= `git describe --tags`
    85
    96build:
    10         env CGO_ENABLED=${CGO} go build ${GOFLAGS} ./cmd/aya
     7        go build ${GOFLAGS} ./cmd/aya
    118clean:
    129        rm -f aya
     10dist:
     11        git archive --format=tar.gz --output=aya-${VERSION}.tar.gz HEAD
    1312install:
    1413        install -Dm0755 aya ${DESTDIR}${PREFIX}/bin/aya
  • trunk/README.md

    r68 r75  
    1111* Highly extensible
    1212* Works well for blogs and generic static websites (landing pages etc)
    13 * Easy to learn
    14 * Fast (duh!)
     13* Easy to learn (you literally don't need to)
     14* Fast (goes without saying)
    1515
    1616## Installation
     
    5353
    5454* `$AYA` - a path to the `aya` executable
    55 * `$AYA_OUTDIR` - a path to the directory with generated files
    56 * `$AYA_FILE` - a path to the currently processed markdown file
    57 * `$AYA_URL` - a URL for the currently generated page
     55* `$AYA\_OUTDIR` - a path to the directory with generated files
     56* `$AYA\_FILE` - a path to the currently processed markdown file
     57* `$AYA\_URL` - a URL for the currently generated page
    5858
    5959## Example of RSS generation
  • trunk/cmd/aya/main.go

    r74 r75  
    1 // $TheSupernovaDuo: marisa.chaotic.ninja/aya/cmd/aya, v0.6.4 2023-10-23 22:26:23, yakumo_izuru Exp $
     1// $TheSupernovaDuo: marisa.chaotic.ninja/aya/cmd/aya, v0.6.6 2023-12-03 23:48:17+0000, yakumo_izuru Exp $
    22package main
    33
     
    1616        "github.com/russross/blackfriday/v2"
    1717        "github.com/yosssi/gcss"
    18         "gopkg.in/yaml.v2"
     18        "gopkg.in/yaml.v3"
    1919        "marisa.chaotic.ninja/aya"
    2020)
  • trunk/go.mod

    r71 r75  
    77        github.com/russross/blackfriday/v2 v2.1.0
    88        github.com/yosssi/gcss v0.1.0
    9         gopkg.in/yaml.v2 v2.4.0
     9        gopkg.in/yaml.v3 v3.0.1
    1010)
  • trunk/go.sum

    r71 r75  
    77gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
    88gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
    9 gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
    10 gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
     9gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
     10gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
  • trunk/vendor/modules.txt

    r71 r75  
    99## explicit
    1010github.com/yosssi/gcss
    11 # gopkg.in/yaml.v2 v2.4.0
    12 ## explicit; go 1.15
    13 gopkg.in/yaml.v2
     11# gopkg.in/yaml.v3 v3.0.1
     12## explicit
     13gopkg.in/yaml.v3
  • trunk/version.go

    r72 r75  
    44import (
    55        "fmt"
     6        "time"
    67)
    78
    89var (
    9         // Version release version
    10         Version = "0.0.1"
    11 
    12         // Commit will be overwritten automatically by the build system
    13         Commit = "HEAD"
     10        // Set to current tag
     11        Version = "v0.6.6"
     12        Time = time.Now()
    1413)
    1514
    1615// FullVersion display the full version and build
    1716func FullVersion() string {
    18         return fmt.Sprintf("%s@%s", Version, Commit)
     17        d := Time.Day()
     18        m := Time.Month()
     19        y := Time.Year()
     20        return fmt.Sprintf("%v || %d.%d.%d", Version, y, m, d)
    1921}
Note: See TracChangeset for help on using the changeset viewer.