<!doctype html>
<html class="no-js" lang="id">
<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title><?= $title ?? 'SMKN 1 Sukalarang' ?></title>
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <meta property="og:type" content="article">
    <meta property="og:url" content="<?= current_url() ?>">
    <meta property="og:title" content="<?= $title ?? 'SMKN 1 Sukalarang' ?>">
    <meta property="og:description" content="Portal Resmi SMK Negeri 1 Sukalarang - Negla Ngajadi!">
    
    <?php 
        // Cek apakah ada gambar berita, jika tidak gunakan gambar default sekolah
        if (isset($berita['gambar']) && !empty($berita['gambar'])) {
            $img_url = base_url('uploads/berita/' . $berita['gambar']);
        } else {
            // Pastikan file background.jpg ini ada di folder assets/img/
            $img_url = base_url('assets/img/background.jpg');
        }
    ?>
    <meta property="og:image" content="<?= $img_url ?>">
    <meta property="og:image:secure_url" content="<?= $img_url ?>">
    <meta property="og:image:type" content="image/jpeg">
    <meta property="og:image:width" content="1200">
    <meta property="og:image:height" content="630">
    <meta property="og:image:alt" content="<?= $title ?? 'SMKN 1 Sukalarang' ?>">

    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:title" content="<?= $title ?? 'SMKN 1 Sukalarang' ?>">
    <meta name="twitter:image" content="<?= $img_url ?>">

    <link rel="icon" type="image/png" sizes="32x32" href="<?= base_url('assets/img/logo_sekolah.png') ?>">
    <link rel="shortcut icon" type="image/x-icon" href="<?= base_url('assets/img/logo_sekolah.png') ?>">
    
    <link rel="stylesheet" href="<?= base_url('assets/css/bootstrap.min.css') ?>">
    <link rel="stylesheet" href="<?= base_url('assets/css/icons.min.css') ?>">
    <link rel="stylesheet" href="<?= base_url('assets/css/plugins.css') ?>">
    <link rel="stylesheet" href="<?= base_url('assets/css/style.css') ?>">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
    
    <script src="<?= base_url('assets/js/vendor/modernizr-3.11.7.min.js') ?>"></script>
</head>
<body>

    <?= $this->include('layout/header') ?>

    <main>
        <?= $this->renderSection('content') ?>
    </main>

    <?= $this->include('layout/footer') ?>

    <script src="<?= base_url('assets/js/vendor/jquery-v2.2.4.min.js') ?>"></script>
    <script src="<?= base_url('assets/js/popper.min.js') ?>"></script>
    <script src="<?= base_url('assets/js/bootstrap.min.js') ?>"></script>
    <script src="<?= base_url('assets/js/plugins.js') ?>"></script>
    <script src="<?= base_url('assets/js/main.js') ?>"></script>

</body>
</html>